This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: FUNCTION_OK_FOR_SIBCALL vs INITIAL_FRAME_POINTER_OFFSET
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Paul Brook'" <paul at codesourcery dot com>, <gcc at gcc dot gnu dot org>
- Cc: "'Richard Henderson'" <rth at redhat dot com>
- Date: Tue, 21 Mar 2006 15:15:18 -0000
- Subject: RE: FUNCTION_OK_FOR_SIBCALL vs INITIAL_FRAME_POINTER_OFFSET
On 21 March 2006 15:12, Paul Brook wrote:
> On Tuesday 21 March 2006 14:57, Richard Henderson wrote:
>> On Mon, Mar 20, 2006 at 04:03:08PM -0000, Dave Korn wrote:
>>> Do you happen to know off the top of your head when get_frame_size()
>>> becomes valid?
>>
>> You don't get a good first-pass estimate until after all rtl
>> generation has been done. Which is later than you need.
>>
>> Another possibility is to allocate an extra word high in the
>> stack frame for temporary storage in large frames w/ sibcalls
>> to functions using all arguments. Then you'd deallocate in several steps:
>>
>> scratchslot = argument
>> argument = stack frame size - small
>> sp += argument
>> argument = scratchslot
>> sp += small
>
> This assumes you have a frame pointer or sp+large_offset addressing mode for
> accessing scratchslot. In which case you could either use fp as scratch
> storage or probably have an add sp, large_offset instruction.
>
> Paul
:) OK, I'll allocate a successive series of scratchslots every 32k all the
way up the stack and bounce the (continuously-reducing) frame size argument
from one to the next until we get within range of the top!
cheers,
DaveK
--
Can't think of a witty .sigline today....