This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
x86 throw causing stack leak
- From: "Colin Burgess" <cburgess at qnx dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 12 Dec 2001 11:54:58 -0500 (est)
- Subject: x86 throw causing stack leak
In gcc 2.95.3, there is a stack leak when throwing exceptions on x86, when
optmizing.
During expand_throw, when generating the call to __cp_push_exception, the
fdeferpop option is is causing the restoration of the stack pointer to be
deferred, but it isn't ever being restored. This is causing a 16 byte
leak of stack every time you throw.
The solution is to put a NO_DEFER_POP/OK_DEFER_POP around this section,
or handle pending_stack_adjust after the call to expand_expr for the
__cp_push_exception.
I'm not sure if this affects the 3.x tree, since the C++ exception
stuff has changed considerably.
--
cburgess@qnx.com