This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]