GCC 4.7.2 will have Win64 SEH (by default)

Hi,

I have just been made aware that GCC 4.7.2 and later will use SEH by default on Win64:
http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00512.html

I would like to inquire as to possibility of this being implemented in Clang/LLVM. As this type of exception handling is much closer to the classic Dwarf model currently used, I hope it won’t be too difficult to implement this in Clang? Remember that Win64 EH is broken right now, so any improvement is the right improvement :wink:

For 32-bit dw2 eh already works well, and in light of the misty Borland patents will probably remain the only option for a while.

Thanks!

Ruben

PS: please also reply to my email address, as I’m not subscribed to cfe-dev

Charles Davis did a lot of work on Win64 SEH support in LLVM, check commits r131652-r132880.

As I haven’t tested it yet, what exactly is broken?

+LLVMdev

Charles Davis did a lot of work on Win64 SEH support in LLVM, check commits r131652-r132880.

As I haven’t tested it yet, what exactly is broken?

It’s not finished yet. All the stuff for assembly code that uses Win64 EH is done, but not the code-gen-side stuff (cf. Win64Exception class in CodeGen). I was about to finish it, but then real life happened :). This would have allowed us to use DW2-style EH on Win64, but it still would have been problematic for VC++ EH.

Kai Tietz was interested in finishing it, so I emailed him what I have. I assume he’s been working on it–he recently submitted a patch to fix the permissions on .pdata/.xdata sections that I got wrong :). I’ve CC’d him as well so we can see what he has for us.

Chip

Thanks for the update.

I’ve also been researching Windows-specific EH myself, though I have not yet done any specific work on LLVM / Clang. I assume that to be compatible with VC++ EH we need to use the same language-specific EH handler that is located in the MS runtime library. After the LLVM work done, it should be doable to wire that up in Clang.

For anyone who is interested on the low level details, I found a series of posts on the topic by Nynaeve to be really helpful. You can find it at: http://www.nynaeve.net/?p=113