This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Help: Unwinding the C++ stack...throw, longjmp & threads
- To: "George T. Talbot" <george at moberg dot com>
- Subject: Re: Help: Unwinding the C++ stack...throw, longjmp & threads
- From: Richard Henderson <rth at cygnus dot com>
- Date: Wed, 18 Aug 1999 12:00:50 -0700
- Cc: gcc at gcc dot gnu dot org, libc-alpha at sourceware dot cygnus dot com
- References: <37BAD6A5.315C3625@moberg.com>
On Wed, Aug 18, 1999 at 11:52:05AM -0400, George T. Talbot wrote:
> I would like to write a function which unwinds the stack similarly to
> what happens at a throw in C++, but which wouldn't require recompiling
> existing libraries written in C.
>
> Is this possible?
Possible using -fsjlj-exceptions, which is an abomination, so "no".
> Also, does setjmp()/longjmp() assure that C++ destructors for
> stack-based objects are called?
No.
We should instead figure out why the 5% performance degradation
and fix it. IN THEORY, it shouldn't matter -- the complexity to
compilation comes when you have exception handlers, not throws.
We should not care that some called function throws through any
more than we care if they longjmp though.
Probably it is the case that some pass that has yet to be
converted to the properly use the new CFG is misinterpreting
basic block boundaries in the presence of flag_exceptions.
r~