__builtin_longjmp and rs6000 TOC
David Edelsohn
dje@watson.ibm.com
Thu Jan 29 19:57:00 GMT 1998
>>>>> David Edelsohn writes:
>> While longjmp does
>> not guarantee the nesting, unless nonlocal_goto is defined only to be
>> valid for intra-module nested jumps, I do not see how one can avoid the
>> worst case intermodule case.
>>>>> Jeffrey A Law writes:
Jeff> I don't remember anything restricting nonlocal gotos to these cases.
>>>>> Richard Henderson writes:
> Eh? Nested functions across module boundaries?
> I am suggesting that we do just that -- make nonlocal_goto be
> defined only for intra-module jumps, and that longjmp be used
> for inter-module jumps.
The GCC documentation on the __label__ extension states:
You can use this mechanism to jump to code in a different function. If
you do that, totally unpredictable things will happen. The best way to
avoid this is to store the label address only in automatic variables and
never pass it as an argument.
A nested function always has internal linkage. Declaring one with
@code{extern} is erroneous. If you need to declare the nested function
before its definition, use @code{auto} (which is otherwise meaningless
for function declarations).
I think this probably allows TOC and other things to fail if jumping
between modules via labels (nonlocal gotos) instead of setjmp/longjmp so
Richard's distinction does seem justified allowing the optimization. I
withdraw my concern.
David
More information about the Gcc
mailing list