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

Tony Hosking hosking at cs.purdue.edu
Mon Jan 3 00:19:36 CET 2011


My take was that we would use the unwind support with RTExStack along with recording the flow constraints for the IR.  They were never that tricky.

On Jan 2, 2011, at 3:29 AM, Jay K wrote:

> 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/2c2016d5/attachment-0002.html>


More information about the M3devel mailing list