Calling convention that gets frame pointer register clobbered
Jim Wilson
wilson@specifixinc.com
Tue Dec 16 04:49:00 GMT 2003
On Mon, 2003-12-15 at 18:02, Latchesar Ionkov wrote:
> I already thought of that, but emitting the push right before the actual
> call won't work, because it will shift the function arguments.
Ah, right, I should have thought of that myself.
There are probably two places you have to change, the expand_call
function which is used for normal calls, and the
emit_library_call_value_1 function which is used for helper functions
like the libgcc2 adddi3 function.
You might be able to handle this like the existing
structure_value_addr_parm, that is a hidden argument for structure
return values. So we would have another hidden argument for the frame
pointer. Except that changes the ABI, so I guess that doesn't work
either.
The compiler may not like seeing saves/restores of the frame pointer,
and may not handle this correctly in the optimizer. You might have to
do something in the optimizers to deal with that. This is something
that can be avoided if the fp saves/restores are hidden in the call
patterns, and only emitted as assembly code, but unfortunately that
isn't a choice.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list