I already have nonlocal_goto, and  nonlocal_goto_receiver.

These expect saved frame pointer to be virtual_stack_vars_rtx+1.

For setjmp the value is determined by targetm.builtin_setjmp_frame_value - which I defined and is correct.

But for goto the value is created by some other code - which appears to be wrong but I can't find!




-----Original Message-----
From: David Daney <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: gcc@gcc.gnu.org
Sent: Thu, 22 May 2008 1:16 pm
Subject: Re: Where is setup for "goto" in nested function created?


[EMAIL PROTECTED] wrote: 
During the process of fixing setjmp for AVR target, I needed to
define > targetm.builtin_setjmp_frame_value () to be used in 
expand_builtin_setjmp_setup(). 
> This sets the value of the Frame pointer stored in jump buffer. 
> I set this "value" to virtual_stack_vars_rtx+1 (==frame_pointer) 
Receiver defined in target latter restores frame pointer using >
virtual_stack_vars_rtx = value - 1 
> This produce correct code as expected and avoids run-time add/sub
of > offsets. (setjmp works!) 
> However, for a normal goto used inside a nested function, a
different > part of gcc creates the code to store frame pointer (not > expand_builtin_setjmp_setup). I can't find this code. 
> The issue I have is that this "goto_setup" code does NOT use >
targetm.builtin_setjmp_frame_value - but seems to use > value=virtual_stack_vars_rtx, which is incompatible with my target > receiver. 
> So where is the goto setup code created? And is there a bug here? 
 
Perhaps you need to implement one or more of: save_stack_nonlocal, restore_stack_nonlocal, nonlocal_goto, and/or nonlocal_goto_receiver. 
 
David Daney 

Reply via email to