Reload patch for PA call rewrite.

Richard Henderson rth@redhat.com
Fri Oct 25 15:44:00 GMT 2002


On Thu, Oct 24, 2002 at 12:44:34PM -0600, Jeff Law wrote:
> Eliminating a generic tail call may be a lose, particularly on processors
> which use a branch target stack as the call/return sites no longer match
> perfectly

This is incorrect.  The return target stack is still intact.

Consider a()->b()->c().  If there are no tail calls, then
in C, the return stack is two deep, and we pop them both off
with two return instructions.  If B tail calls, then in C the
return stack is only one deep, and we pop that one off with
one return instruction.

I suppose it could make a difference to targets that don't
have a separate return instruction, and whose architecture
doesn't suggest a canonical return register.  (Examples of
the later is MIPS (indirect branch with r31) and PPC
(indirect branch with lr)).  I don't know how PA treats this.


r~



More information about the Gcc-patches mailing list