This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Implementation of Exceptions
- From: dewar at gnat dot com (Robert Dewar)
- To: gcc at gcc dot gnu dot org, halldori at ru dot is
- Date: Thu, 4 Apr 2002 10:30:28 -0500 (EST)
- Subject: Re: Implementation of Exceptions
>>Am I missing some important detail here?
No, you are not missing anything. It is of course possible to optimize
throwing of exceptions if you accept extra overhead on function calls.
Now normally we think in terms of taking overhead ONLY on function calls
which have associated exceptoin handlers (e.g. the setjmp/longjmp approach
used in GNAT on many targets). Your scheme seems to introduce overhead
in every call. I suppose it might help on some peculiar applications, but
overall it would be a clear loss. Typically exception handlers are established
FAR FAR more often than exceptions are thrown in reasonably written programs.
So I think your implementation, while technically sound, would be a loss for
almost all applications.