[Exception Handling] Is the default -funwind-tables still required on x86?

Hi All,

Recently I fixed a bug that was exposed on PowerPC relating to missing unwind tables.


Patch For Fix:

The bug was not exposed on x86 because the option -funwind-tables is on by default and so the uwtable attribute is added to all functions on x86. With the fix an unwind table is added to any function that has an error handling personality. My questions: 1) Why is -funwind-tables default on x86? 2) Does it still need to be default now that this fix is in?

Thank you,

Yes, I think we should continue emit unwind info into .eh_frame on x86 by default, even for C code that doesn’t use EH. It’s nice to have unwind information in the binary so that you can unwind the stack anywhere in the program.

I think that’s the right default, I’m not sure why it’s even architecture specific, though. I’d rather enable -funwind-tables by default on more architectures. Maybe the default -funwind-tables logic in clang should be a blacklist of legacy ISAs that don’t want .eh_frame by default instead of whitelist of where to enable it by default.