[Bug c/56512] Memory corruption when compiling code with -O on PowerPC when using setjmp/longjmp

erik.brangs at gmx dot de gcc-bugzilla@gcc.gnu.org
Sun Mar 3 15:41:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56512

--- Comment #2 from Erik Brangs <erik.brangs at gmx dot de> 2013-03-03 15:41:21 UTC ---
I'm actually trying to reproduce another bug with setjmp/longjmp on PowerPC
(one that leads to the error message "longjmp causes unitialized stack frame").
Unfortunately, I haven't yet succeeded in extracting a suitable testcase from
that because there is a lot of of code (including code not in C and not
compiled by gcc) between the call to setjmp and the call to longjmp. In that
case, the function where the setjmp happens is "exited" via a call to another
function so the frame should be left intact.

I was hoping that the behaviour from the attached file might be related, but it
seems that this is not the case.

The explanation on Wikipedia said that returning to a frame that has been
exited via longjmp out is undefined in C99. Is that also the case in older
standards?

I'll just resolve this bug if there's nothing salvagable in the attached file.
Thanks for taking time to help me.



More information about the Gcc-bugs mailing list