[LLVMbugs] [Bug 2293] New: lli/llc crash with "Cannot promote to smaller type"

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue May 6 09:19:44 PDT 2008


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

           Summary: lli/llc crash with "Cannot promote to smaller type"
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: jonas at mit.edu
                CC: llvmbugs at cs.uiuc.edu


The following code, 

; ModuleID = 'bugpoint-reduced-simplified.bc'

define i32 @main() {
entry:
        br label %forloop1_for_block
forloop1_for_block:             ; preds = %forloop1_for_block, %entry
        %forloop1_for_phi = phi i3 [ 0, %entry ], [ %nextvar,
%forloop1_for_block ]; <i3> [#uses=1]
        %nextvar = add i3 %forloop1_for_phi, 1          ; <i3> [#uses=1]
        br label %forloop1_for_block
}



causes lli and llc from svn trunk (r50721) to crash, with a message such as:
[jonas at hamiltonian swig.svn]$ lli bugpoint-reduced-simplified.bc 

lli: LegalizeDAG.cpp:4054:
llvm::SDOperand<unnamed>::SelectionDAGLegalize::PromoteOp(llvm::SDOperand):
Assertion `NVT > VT && MVT::isInteger(NVT) == MVT::isInteger(VT) && "Cannot
promote to smaller type!"' failed.

lli[0xcde54a]

lli[0xcde674]

/lib/libc.so.6[0x2b3b0be6e7d0]

/lib/libc.so.6(gsignal+0x35)[0x2b3b0be6e765]

/lib/libc.so.6(abort+0x110)[0x2b3b0be701c0]

/lib/libc.so.6(__assert_fail+0xef)[0x2b3b0be67c2f]

lli[0xa7d5d9]

lli[0xa8fa3b]

lli[0xa8fe5f]

lli(_ZN4llvm12SelectionDAG8LegalizeEv+0x4d)[0xa8ffe1]

lli(_ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGERNS_12SelectionDAGE+0xe3)[0x9e3df7]

lli(_ZN4llvm16SelectionDAGISel16SelectBasicBlockEPNS_10BasicBlockERNS_15MachineFunctionERNS_20FunctionLoweringInfoE+0xcb)[0x9fc159]

lli(_ZN4llvm16SelectionDAGISel13runOnFunctionERNS_8FunctionE+0x20e)[0x9fdf72]

lli[0x86ed41]

lli(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x129)[0xc79c8b]

lli(_ZN4llvm23FunctionPassManagerImpl3runERNS_8FunctionE+0x74)[0xc79eb2]

lli(_ZN4llvm19FunctionPassManager3runERNS_8FunctionE+0x86)[0xc7a016]

lli(_ZN4llvm3JIT16runJITOnFunctionEPNS_8FunctionE+0x75)[0x96d753]

lli(_ZN4llvm3JIT20getPointerToFunctionEPNS_8FunctionE+0x224)[0x96dad2]

lli(_ZN4llvm3JIT11runFunctionEPNS_8FunctionERKSt6vectorINS_12GenericValueESaIS4_EE+0x83)[0x96dba9]

lli(_ZN4llvm15ExecutionEngine17runFunctionAsMainEPNS_8FunctionERKSt6vectorISsSaISsEEPKPKc+0x45a)[0x9659ec]

lli(main+0x5f0)[0x802d5a]

/lib/libc.so.6(__libc_start_main+0xf4)[0x2b3b0be5ab44]

lli[0x8022b9]

Aborted (core dumped)



This is on x86_64 linux (ubuntu). I think it might have something to do with
using a phi node with a sub-32 bit type, as virtually identical code with an
i32 does not crash. 

[thanks, LLVM is awesome]


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