There is some talk about preferring Dwarf exceptions instead of the older SJLJ ones with mingw. Unfortunately I cannot find any documentation as to what the tradeoffs are (more than that you cannot throw exceptions between the models).
With the main points:
- SJLJ incurs a performance penalty even when no exceptions are thrown at runtime. The penalty is >10% for typical applications.
- DW2 potentially generates bigger libraries. The overhead however is not big (< 10%) for typical applications.
- if using DW2, things will go wrong (crashing?) if one tries to throw exceptions through stack frames not compiled with DW2 (typical case: Windows callbacks).
- following from the above, one should never mix code compiled with DW2, and code compiled with SJLJ, in one project.
- mingw.org has switched to DW2 since a while.
- For gcc 4.7/64 bit, only SJLJ is available. gcc 4.8 will feature SEH, which solves the performance problems SJLJ has. Anyhow, gcc 4.8 most probably won't feature SEH for 32 bit.