[LLVMbugs] [Bug 5049] New: incorrect asserting conditions in TargetLowering.h

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Sep 25 10:08:11 PDT 2009


           Summary: incorrect asserting conditions in TargetLowering.h
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Target Description Classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: micah.villmow at amd.com
                CC: llvmbugs at cs.uiuc.edu

setLoadExtAction(ISD::SEXTLOAD, MVT::v2f64, Expand)
setLoadExtAction(ISD::SEXTLOAD, MVT::v4f64, Expand) causes this assert to

    assert((unsigned)VT.SimpleTy < sizeof(LoadExtActions[0])*4 &&
           ExtType < array_lengthof(LoadExtActions) &&
           "Table isn't big enough!");

@ line 982 because the type used to be uint32_t.

The problem comes that sizeof(LoadExtActions[0]) == 8 and 8 * 4 = 32, but both
v2f64 and v4f64 have ID's 32 and 33 respectively, causing this assert to

The correct method of doing this assert should be
assert((unsigned)VT.SimpleTy < LAST_VALUETYPE &&
ExtType < array_lengthof(LoadExtActions) &&
           "Table isn't big enough!");

Other asserts that also will be triggered because of this are in
setTruncStoreAction, setConvertAction, setCondCodeAction, when the MemVT ==
(v2f64 || v4f64).

The functions setIndexedLoadAction and setIndexedStoreAction actually get this
correct, so someone has hit this assert before but neglected to updated all
asserts in the file.

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