Difference between stack pointer and frame addressduringcodegeneration
Vladimir Makarov
vmakarov@redhat.com
Wed Mar 2 19:45:00 GMT 2005
Ãyvind Harboe wrote:
>>>Does something along the lines of a "FINAL_ELIMINATION_OFFSET()" exist,
>>>that can be called from code-generation in the back-end?
>>>
>>>
>>>
>>>
>>>
>>Sorry, I don't understand what you mean saying "code-generation in the
>>back-end". As I wrote there is no "FINAL_ELIMINATION_OFFSET" before
>>reload. After the reload it is INITIAL_ELIMINATION_OFFSET.
>>
>>
>
>E.g. INITIAL_ELIMINATION_OFFSET() does not take into account how the
>stack pointer changes as arguments are pushed onto the stack before a
>function call.
>
It is defined by API. If API requires to allocate stack space for out
coming arguments then INITIAL_ELIMINATION_OFFSET should take it into
account.
>What I'm wondering about is whether it is possible, in the code that
>gets invoked in a "define_insn" to generate the actual assembly, to find
>out the difference between the SP and the frame address.
>
>
You shoul have asked this the first time. What I wrote was a general
case (it should be taken into account from machine-independent code).
For a given architecture the answer could be different. In some APIs,
the difference between sp and fp is always size of local variables and
not changed. You should check API of the target you are interesting in
to get the answer.
Vlad
>
>
More information about the Gcc
mailing list