[LLVMbugs] [Bug 5275] New: "opt -inline" sometimes fails silently in 2. 6 and current trunk

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Oct 22 06:57:08 PDT 2009


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

           Summary: "opt -inline" sometimes fails silently in 2.6 and
                    current trunk
           Product: tools
           Version: 2.6
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: miscompilation
          Severity: major
          Priority: P2
         Component: opt
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: claesenm at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=3687)
 --> (http://llvm.org/bugs/attachment.cgi?id=3687)
Compiling this code produces the bug, one function argument will be "undef" in
LLVM IR

In the (not yet officially released) 2.6 source of LLVM and today's SVN trunk
opt seems to be bugged for the inline function.

When inlining, a function argument becomes "undef" in the LLVM IR. This IR
passes verification and is happily passed on to later passes. The code compiles
"correctly" but the binary will cause segmentation faults when executed.

I've attached a piece of c source code that produces this bug.
My steps are:
$ llvm-gcc -c -emit-llvm code.c -o correct.bc
$ opt -inline -verify-each correct.bc -o broken.bc
$ llvm-dis broken.bc -o broken.ll
$ llc broken.bc -o broken.s
$ llvm-gcc broken.s -o segfaultprogram
$ ./segfaultprogram => causes segmentation fault

code.c is added as an attachment and opt used to inline this perfectly in 2.5,
but not anymore for me. The reason I marked the severity as major is because it
fails silently.


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