[LLVMbugs] [Bug 3214] New: Exception handling doesn't preserve callee-saved registers

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Dec 15 13:18:45 PST 2008


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

           Summary: Exception handling doesn't preserve callee-saved
                    registers
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: miscompilation
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: fvbommel at wxs.nl
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=2304)
 --> (http://llvm.org/bugs/attachment.cgi?id=2304)
gzipped test case

When I compile some simple exception-using code with LDC
(http://www.dsource.org/projects/ldc):
-----
module throws;

void main() { throw new Exception("test"); }
-----
and link it to an all-bc runtime (using llvm-gcc for the c files), this code
segfaults after the runtime catches the exception.

(Ubuntu 8.10 x86-64)

>From what gdb tells me, it seems that callee-saved registers aren't preserved
between the code in the try-block that contains the call to _Dmain (which is
what the code above compiles to) when it throws an exception.

This looks like an LLVM bug, not an LDC bug (since it's CPU-register level
stuff).

I'm attaching a .bc file. Unfortunately, it's rather large since it contains
much of the D runtime so LDC isn't needed to examine this.
=====
$ llc <bitcode.bc | as -o native.o && gcc native.o -lpthread -ldl -o native
$ ./native
: Segmentation fault
=====


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