[LLVMbugs] [Bug 2476] New: assertion when custom expanding ISD::ADD or ISD::SUB

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Jun 20 09:12:56 PDT 2008


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

           Summary: assertion when custom expanding ISD::ADD or ISD::SUB
           Product: libraries
           Version: 2.3
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Common Code Generator Code
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rlsosborne at gmail.com
                CC: llvmbugs at cs.uiuc.edu


In my target I have 32bit registers and must custom expand 64bit adds and subs.
I soon as I do this I hit an assertion in the ExpandOp in LegalizeDAG.cpp:

llc:
/homelocal/richard/llvm/tools_llvm/src/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:6724:
void<unnamed>::SelectionDAGLegalize::ExpandOp(llvm::SDOperand,
llvm::SDOperand&, llvm::SDOperand&): Assertion `isNew && "Value already
expanded?!?"' failed.
llc[0xe358c6]
llc[0xe359eb]
/lib64/tls/libc.so.6[0x356b22e2f0]
/lib64/tls/libc.so.6(gsignal+0x3d)[0x356b22e25d]
/lib64/tls/libc.so.6(abort+0xfe)[0x356b22fa5e]
/lib64/tls/libc.so.6(__assert_fail+0xf1)[0x356b227ae1]
llc[0xbcdf27]
llc[0xbd560c]
llc[0xbd5990]
llc(_ZN4llvm12SelectionDAG8LegalizeEv+0x4b)[0xbd5adf]
llc(_ZN4llvm16SelectionDAGISel17CodeGenAndEmitDAGERNS_12SelectionDAGE+0xd1)[0xb5962d]
llc(_ZN4llvm16SelectionDAGISel16SelectBasicBlockEPNS_10BasicBlockERNS_15MachineFunctionERNS_20FunctionLoweringInfoE+0xb5)[0xb70b15]
llc(_ZN4llvm16SelectionDAGISel13runOnFunctionERNS_8FunctionE+0x20b)[0xb7295d]
llc(_ZN4llvm13FPPassManager13runOnFunctionERNS_8FunctionE+0x127)[0xdc9305]
llc(_ZN4llvm23FunctionPassManagerImpl3runERNS_8FunctionE+0x74)[0xdc952e]
llc(_ZN4llvm19FunctionPassManager3runERNS_8FunctionE+0x80)[0xdc968c]
llc(main+0x8a8)[0x798d2e]
/lib64/tls/libc.so.6(__libc_start_main+0xdb)[0x356b21c3fb]
llc(atan+0xfa)[0x79780a]
Aborted

The problem seem to be that in the case of ISD::ADD and ISD::SUB Op is set to
the value returned by TLI.LowerOperation which then has ExpandOp called on it.
Instead Op should be left as the original value.


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