[LLVMdev] exception handling broken on x86-64?

Thomas Neumann tneumann at users.sourceforge.net
Sat Feb 9 06:53:47 PST 2008


Hi,

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 is
thrown but never caught.
This can be seen by this trivial example:

#include <iostream>
using namespace std;
class A { };
int main()
{
   cout << "A" << endl;
   try {
       cout << "B" << endl;
       throw A();
       cout << "C" << endl;
   } catch (const A&) {
      cout << "D" << endl;
   }
   cout << "E" << endl;
}


When compiled with llvm-g++ it aborts after printing "B". The generated
assembler code looks reasonable at a first glance, but something must
be broken. Any ideas about how to debug this?

I build the gcc 4.2 snapshot from the second release candidate with
--disable-multilib and --disable-shared to get it to build (as
suggested by the readme). llvm itself was build without special
options.

Thomas





More information about the llvm-dev mailing list