Richard Henderson schrieb:
On 03/11/2011 05:43 AM, Georg-Johann Lay wrote:
I did not find a way to make this work together with -mcall-prologues.
Please let me know if you have suggestion on how call prologues can be
combine with tail calls.
You need a new symbol in libgcc for this. It should be easy enough to have
the sibcall epilogue load up Z+EIND before jumping to the new symbol
(perhaps called __sibcall_restores__). This new symbol would be just like
the existing __epilogue_restores__ except that it would finish with an
eijmp/ijmp instruction (depending on multilib) instead of a ret instruction.
The point is that the intent of -mprologue-saves is to save program
memory space (flash). If we load the callee's address in the epilogue,
the epilogue's size will increase. Moreover, adding an other lengthy
function besides __epilogue_restores__ to libgcc, that will increase
code size because in many cases we will see both epilogue flavors
being dragged into application.