[LLVMbugs] [Bug 8560] New: Uninitialised memory access issue with llvm::PHINode::reserveOperandSpace

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Nov 6 07:05:44 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=8560

           Summary: Uninitialised memory access issue with
                    llvm::PHINode::reserveOperandSpace
           Product: new-bugs
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: bnwest at rice.edu
                CC: llvmbugs at cs.uiuc.edu


I am developing a new optimization pass.  I am experiencing some erratic
execution problems, so I decided to 'memcheck' the opt built with my -osr
optimization.  The results suggest that there is an 'uninitialised value'
access.  To be precise the error is "Conditional jump or move depends on
uninitialised value(s)".

This is the sequence of my code that cause the problem:

    PHINode *phinode;
    phinode = PHINode::Create(optype, Twine(), IV);
    phinode->reserveOperandSpace(NumOperands/2);

As of revision 117932 ...


/usr/local/bin/valgrind --leak-check=yes opt sort.ssa.ll -S -o sort.osr.ll
-stats -osr

==71994== Memcheck, a memory error detector
==71994== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==71994== Using Valgrind-3.6.0 and LibVEX; rerun with -h for copyright info
==71994== Command: opt sort.ssa.ll -S -o sort.osr.ll -stats -osr
==71994== 
--71994-- /Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt:
--71994-- dSYM directory is missing; consider using --dsymutil=yes
==71994== Warning: ignored attempt to set SIGUSR2 handler in sigaction();
==71994==          the SIGUSR2 signal is used internally by Valgrind
==71994== Conditional jump or move depends on uninitialised value(s)
==71994==    at 0x1003E71B1: llvm::PHINode::resizeOperands(unsigned int) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x1001B4DC1: llvm::PHINode::reserveOperandSpace(unsigned int)
(in /Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x1001206DB: (anonymous
namespace)::OperatorStrengthReduction::Reduce(llvm::Instruction*, unsigned int,
llvm::Type const*, llvm::Value*) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x100122535: (anonymous
namespace)::OperatorStrengthReduction::Replace(llvm::Instruction*,
llvm::Instruction*, llvm::Value*) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x100122D1C: (anonymous
namespace)::OperatorStrengthReduction::ProcessSCC(std::vector<llvm::Instruction*,
std::allocator<llvm::Instruction*> >) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x1001231D8: (anonymous
namespace)::OperatorStrengthReduction::DFS(llvm::Instruction*) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x10012334C: (anonymous
namespace)::OperatorStrengthReduction::OSR(llvm::Function&) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x1001234BB: (anonymous
namespace)::OperatorStrengthReduction::runOnFunction(llvm::Function&) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x100411969:
llvm::FPPassManager::runOnFunction(llvm::Function&) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x100411B3C: llvm::FPPassManager::runOnModule(llvm::Module&)
(in /Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x100411639: llvm::MPPassManager::runOnModule(llvm::Module&)
(in /Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)
==71994==    by 0x100412DEA: llvm::PassManagerImpl::run(llvm::Module&) (in
/Users/bnwest/PACE/LLVM/llvm/build/Debug+Asserts/bin/opt)

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list