> If ebp needs to be saved because it contains a user variable, it is
> better
> not to pop it in the prologue - pop it in the epilogue instead, and you
> don't
> need to have another save/restore.
Sounds reasonable. Is there any flag I can set to make the epilogue pop ebp?
 
> This can be done with much shorter assembly, at the cost of a bit more
> logic in your prologue / epilogue expanders:
> 
> mov.s %edi, %edi
> push %ebp
> mov.s %esp, %ebp
> leal ... (adjust value to account for the ebp stack slot)
Yes, but then ebp contains the value of esp before it was realigned.
Couldn't that cause problems? Of course I guess I could just copy %esp into
%ebp again after the leal. The other concern is that now %ebp is in the
unaligned address on the stack, while before that it was aligned.


Reply via email to