exception handling broken on x86-64?

Hello, Thomas

when building the second release candidate of llvm 2.2 I noticed that
exception handling seems to be broken on Linux x86-64. The exception

EH never worked on x86-64. Mainly due to absence of intrinsics used in
unwinding runtime. Also, some other important stuff is missed as well
(like stack layout information).

When compiled with llvm-g++ it aborts after printing "B". The generated
assembler code looks reasonable at a first glance,

It shouldn't. At least all frame moves information is missing.

but something must be broken. Any ideas about how to debug this?

I'd suggest to start with filling necessary bits in the
X86RegisterInfo.cpp. This includes frame moves information and
description of stack layout.

Then you can proceed to x86-64-specific lowering of some important
intrinsics. You can link your code with native g++ in order to use
gcc-provided (and thus working) runtime.

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

Thomas