Bad code from egcs-1.1b

Gary Thomas gdt@linuxppc.org
Mon Sep 28 01:28:00 GMT 1998


I've finally tracked down the code-gen problems with EGCS-1.1b.
It seems that it's possible to have a piece of code that creates
an object, with appropriate error handling setup code, that does
not destroy the object or clean up the error handler on exit.

On the PowerPC (at least) this has very serious side effects.  In
particular, the error handler objects are on the stack which has
now been popped away.  When the next error handler create/cleanup
runs it accesses invalid stack locations and the program fails
miserably.

I've attached a very small C++ program along with the generated
assembly code.  The assembly has been hand edited with some "###(n)"
comments to help you associate the C++ code with the assembly.
I don't know of a way to write a test case that can properly test
this, sorry.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug2.cpp
Type: text/x-c++
Size: 1511 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19980928/2ece03d8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug2.s
Type: text/x-asm
Size: 6242 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19980928/2ece03d8/attachment-0001.bin>


More information about the Gcc-bugs mailing list