Created attachment 8385 [details] Repro program We are currently porting our application to Windows 64 bits (amd64), and we are getting regressions from 32 bits relatively to LLVM 3.0's ability to get traversed by "foreign" Visual Studio C++ exceptions. That is, there is a crash when C++ exceptions which are thrown from Visual Studio code, are unwinding through LLVM code before being eventually catch by other Visual Studio code. Note: I am not sure if this is specific to Visual Studio. I was able to repro the issue simply by modifying the Fibonacci example to call an external C++ function which throws an exception, much like in ExceptionsDemo.cpp: works on 32 bits but not on 64 bits Visual Studio. The crash happens within Windows' _cxxThrowException routine. Attached is the file containing the "repro" executable (to be compiled with the same settings as the Fibonacci example). The program does a recursive call of depth "N", with "N" being passed as an arg (like in the Fibonacci example). Here it crashes even with N=0, on 64 bits.
Clang has not supported Win64 EH yet. LLVM might support it, but it is not activated IIRC. (In reply to comment #0) > We are currently porting our application to Windows 64 bits (amd64), and we are > getting regressions from 32 bits relatively to LLVM 3.0's ability to get > traversed by "foreign" Visual Studio C++ exceptions. That is, there is a crash > when C++ exceptions which are thrown from Visual Studio code, are unwinding > through LLVM code before being eventually catch by other Visual Studio code. I don't imagine i686-msvc-llvm could handle MS EH.
The issue is that JITs need to register xdata with the OS on win64. LLVM's JIT has never had this ability. PR24233 has a better description of the work that needs to be done, so I'm duping against it. We already know what xdata to generate because we can compile normal C++ code ahead of time and MSVC exceptions can unwind through our code just fine. *** This bug has been marked as a duplicate of bug 24233 ***