[LLVMbugs] [Bug 1788] New: assertion failure in lib/transforms/IPO/ DeadArgumentElimination

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Nov 9 14:42:30 PST 2007


           Summary: assertion failure in
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: richard.smith at antixlabs.com
                CC: llvmbugs at cs.uiuc.edu

llvm-ld gives an assertion failure "CS.instruction() && Unknown instruction for
the I2I list" in lib/transforms/IPO/DeadArgumentElimination. The app which
provoked it is large and under NDA so cannot be attached, but the reason is

runOnModule in lib/transforms/IPO/DeadArgumentElimination.cpp iterates through
every function and -

(a) checks whether it has varargs but no va_start. If that is so the varargs
are removed and every call to the function is replaced with one which omits the

(b) calls SurveyFunction, and if the funtion has "maybe alive" args, all calls
within the function are pushed to the vector InstructionsToInspect.

In this case, a function processed provokes (b) and pushes the addresses of a
number of call intructions to InstructionsToInspect, one of which is to a
function with unused varargs. Later in the iteration loop that function is
processed provoking (a) - it is modified and all calls to it are replaced. At
this point, InstructionsToInspect still contains a pointer to the original
call, which is now invalid.

When InstructionsToInspect is processed it reaches the invalid pointer and the
random data there happens to provoke the asserion failure reported.

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