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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to