__builtin_longjmp and rs6000 TOC
Richard Henderson
rth@cygnus.com
Thu Jan 29 20:31:00 GMT 1998
On Tue, Jan 27, 1998 at 10:57:26PM -0500, David Edelsohn wrote:
> I have not heard anything more about how to stuff the rs6000 TOC
> register into the machine-dependent portion of GCC's jmp_buf. It does not
> seem that it should be difficult to fixup the nonlocal patterns to do
> this, but it is a somewhat arcane area of GCC about which I am not
> familiar.
Sorry it took a bit to get back to you. I've cleaned up some
patches I had from a bit ago, and added a builtin_longjmp insn
that can be used to override most of the other processing. I did
an example for the Alpha.
The distinction that should be made -- and this should be recorded
somewhere but I'm not sure where -- is that the nonlocal_goto code
is primarily for handling gotos from nested functions, and so should
not have to worry about GOT/TOC issues that are different from
module to module, but are constant between the functions within the
same module. Whereas the longjmp code must handle the later as well.
To get r2 saved, you should
- define builtin_setjmp_setup and write to word 4.
- define builtin_longjmp and restore fp, stack, r2, then jump to lab.
See the Alpha longjmp for details, but it's easy.
You should not need nonlocal_goto_receiver or builtin_setjmp_receiver,
since builtin_longjmp is doing the r2 restoration for you.
r~
More information about the Gcc
mailing list