[M3devel] how to use gcc exception/unwind support?

Jay K jay.krell at cornell.edu
Sun Jan 2 09:29:05 CET 2011

Tony et. al. do you have much idea already in mind of what using gcc exception and/or unwind support would look like?

In particular, do you think we could/should/would use
TRY_CATCH_EXPR, TRY_FINALLY_EXPR? I'm not sure (see below).

Do you understand the difference between WITH_CLEANUP_EXPR and TRY_FINALLY_EXPR?
I don't. Maybe WITH_CLEANUP_EXPR captures a common case is very similar?

Regarding TRY_CATCH_EXPR, TRY_FINALLY_EXPR, they sound very promising.
But does CATCH_EXPR provide the right construct for deciding to catch or not,
and passing the exception properly to the handler?

Or should we use RTExStack nearly or completely unchanged, but:
 1) have it call libgcc/libunwind, via interface RTStack.
 2) in the backend mimic TRY_CATCH_EXPR, TRY_FINALLY_EXPR's affects/pessimisations
  on the control flow graph and such?

Related question is how to model throwing an exception in the backend.
This I had looked at even less (e.g. trying to understand how g++ uses this stuff) but is clearly important.
g++ clearly sometimes calls __cxa_throw, not clear if it always does.
Not clear it does anything else in terms of informing the backend. It looks like not.

 - Jay

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20110102/086c87e6/attachment-0001.html>

More information about the M3devel mailing list