[LLVMbugs] [Bug 1896] New: Global Variable Optimizer fails assertion in OptimizeAwayTrappingUsesOfLoads

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jan 3 05:37:56 PST 2008


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

           Summary: Global Variable Optimizer fails assertion in
                    OptimizeAwayTrappingUsesOfLoads
           Product: new-bugs
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: torvald at se.inf.tu-dresden.de
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=1316)
 --> (http://llvm.org/bugs/attachment.cgi?id=1316)
input .bc file

globalopt fails with an assertion, it cannot handle (or didn't detect) a
bitcast from one pointer type to another (see below). llvm-ld -disable-opt
works well, and created the input .bc (see attachment and backtrace/
instruction dump below).

LLVM 2.1

llvm-ld -native -lpthread -o foo calls-combined.bc -debug-pass=Executions

Pass Arguments:  -internalize -ipsccp -globalopt -constmerge -deadargelim
-instcombine -basiccg -inline -prune-eh -globalopt -globaldce -basiccg
-argpromotion -instcombine -domtree -domfrontier -scalarrepl -globalsmodref-aa
-domtree -loops -loopsimplify -domfrontier -scalar-evolution -licm -memdep -gvn
-dse -instcombine -simplifycfg -globaldce -instcombine -simplifycfg -dce
-globaldce -domtree -verify
[snip]
0x855ab48   Executing Pass 'Global Variable Optimizer' on Module 'foo'...
llvm-ld:
/home/torvald/STM/code/cpp/llvm-2.1/lib/Transforms/IPO/GlobalOpt.cpp:639: bool
OptimizeAwayTrappingUsesOfLoads(llvm::GlobalVariable*, llvm::Constant*):
Assertion `(isa<StoreInst>(*GUI) || isa<PHINode>(*GUI) ||
isa<SelectInst>(*GUI)) && "Only expect load and stores!"' failed.
llvm-ld[0x84a96c6]
llvm-ld[0x84a998c]
[0xffffe420]
/lib/i686/cmov/libc.so.6(abort+0x101)[0xb7d26831]
/lib/i686/cmov/libc.so.6(__assert_fail+0xee)[0xb7d1e08e]
llvm-ld[0x8350a91]
llvm-ld[0x8350db7]
llvm-ld[0x8351de0]
llvm-ld[0x8351fed]
llvm-ld[0x83520ae]
llvm-ld(llvm::MPPassManager::runOnModule(llvm::Module&)+0x100)[0x843f410]
llvm-ld(llvm::PassManagerImpl::run(llvm::Module&)+0x6e)[0x843f5c8]
llvm-ld(llvm::PassManager::run(llvm::Module&)+0x1a)[0x843f61a]
llvm-ld(llvm::Optimize(llvm::Module*)+0x3bf)[0x8273723]
llvm-ld(main+0x689)[0x827b52d]
/lib/i686/cmov/libc.so.6(__libc_start_main+0xe0)[0xb7d10450]
llvm-ld(realloc+0x79)[0x8272ae1]
Aborted

(gdb) bt
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb7caaeb5 in raise () from /lib/i686/cmov/libc.so.6
#2  0xb7cac831 in abort () from /lib/i686/cmov/libc.so.6
#3  0xb7ca408e in __assert_fail () from /lib/i686/cmov/libc.so.6
#4  0x08350a91 in OptimizeAwayTrappingUsesOfLoads (GV=0x8543d20, LV=0x8544d18)
    at /llvm-2.1/lib/Transforms/IPO/GlobalOpt.cpp:637
#5  0x08350db7 in OptimizeOnceStoredGlobal (GV=0x8543d20,
StoredOnceVal=0x8544d18, GVI=@0xbf859364, TD=@0x8557548)
    at /llvm-2.1/lib/Transforms/IPO/GlobalOpt.cpp:1193
#6  0x08351de0 in ProcessInternalGlobal (this=0x85448c0, GV=0x8543d20,
GVI=@0xbf859364)
    at /llvm-2.1/lib/Transforms/IPO/GlobalOpt.cpp:1455
#7  0x08351fed in OptimizeGlobalVars (this=0x85448c0, M=@0x8543cb8)
    at /llvm-2.1/lib/Transforms/IPO/GlobalOpt.cpp:1536
#8  0x083520ae in runOnModule (this=0x85448c0, M=@0x8543cb8) at
/llvm-2.1/lib/Transforms/IPO/GlobalOpt.cpp:2078

(gdb) call (*GUI)->dump()
 i32 * bitcast (void (i32)** @indirect1 to i32*)


-- 
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