exception handling broken on x86-64?

Hello, Thomas

> I'd suggest to start with filling necessary bits in the
> X86RegisterInfo.cpp. This includes frame moves information and
> description of stack layout.
I looked at X86RegisterInfo.cpp, but I think that it already supports
x86-64. At least there were no obvious places were the code would only
work for 32bit mode.

Right. See my last e-mail to Dale. It's really amazing :slight_smile:

After comparing the generated assembler code with native gcc code I
think the generated code is fine, just the exception handler info in
the non-code sections is broken/missing.

It seems, that EH dwarf information emission is disabled in
X86TargetAsmInfo.cpp. Remove the is64Bit() condition near
"SupportExceptionHandling = true" line in X86Subtarget::isELF section.

Also, don't forget to add --enable-eh switch to llc invocation.

You will need to link .S with your native unwinding runtime (so, use g++
to link, not llvm-g++)

After comparing the generated assembler code with native gcc code I
think the generated code is fine, just the exception handler info in
the non-code sections is broken/missing.

It seems, that EH dwarf information emission is disabled in
X86TargetAsmInfo.cpp. Remove the is64Bit() condition near
"SupportExceptionHandling = true" line in X86Subtarget::isELF section.

Also, don't forget to add --enable-eh switch to llc invocation.

Just in case it doesn't work the first time:) patch 46029 might be helpful. That made it work on Darwin for me, and it's possible some of the changes there are also applicable to Linux. Compare your .s with g++ output.

You will need to link .S with your native unwinding runtime (so, use g++
to link, not llvm-g++)

This is not necessary on Darwin, btw, the unwinding stuff Just Worked too.

Where we are on the subject... Are we sure EH is done for x86?

These two tests have never worked on Mac OS X / x86:
SPEC/CINT2006/471.omnetpp
Shootout-C++/except

Evan

Where we are on the subject... Are we sure EH is done for x86?

These two tests have never worked on Mac OS X / x86:
SPEC/CINT2006/471.omnetpp
Shootout-C++/except

Evan

Shootout-C++/except works for me. Anton suggests there may be an issue with the unwinding libraries and he may be right, I'll look at it with you tomorrow.