Port-alpha archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: static link csh/tcsh dumps core



On Mon, Mar 11, 2013 at 01:42:40PM -0400, Christos Zoulas wrote:
> So in the first way it will have the GP from the setjmp() context, in the
> second case it will have the GP from the longjmp() context? Does it make
> a difference?

Usually not, but we don't know. However, with the in-tree code it will have
a random GP value (stack noise).

Side note: Michael Hitch pointed out that the generated assembler code does
actually contain GP restoration code past the call to setjmp, but I just
verified that the statically linked executable has "unop" there instead.

So we are realy seeing link time optimization here, and the compiler is
not at fault - while we technically do not have to preserve GP over
the function call to setjmp itself, we have to set it properly to the
value needed in setjmp, even when doing the longjmp.

And the observed behaviour is not a gcc bug, but a valid optimization.

Mystery solved, I'll commit my patch if there are no objections.

Thanks to everyone, learned a lot - and might now even try to implement 
"context" for boost.


Martin


Home | Main Index | Thread Index | Old Index