This is the mail archive of the
mailing list for the GCC project.
Re: Fix a pretend_args goof in tail calling
- From: Daniel Jacobowitz <drow at false dot org>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 2 May 2005 11:29:29 -0400
- Subject: Re: Fix a pretend_args goof in tail calling
- References: <20041119224844.GA23031@nevyn.them.org> <20050426162901.GA2222@nevyn.them.org> <42756D25.firstname.lastname@example.org>
On Sun, May 01, 2005 at 04:58:29PM -0700, Mark Mitchell wrote:
> The final question is "why shouldn't we use the pretend args space for
> using the outgoing arguments to the sibling call?" If these bytes are
> contiguous with the incoming arguments, then there's no harm. However,
> the documentation for TARGET_ASM_FUNCTION_EPILOGUE (I have no idea why
> pretend_args_size is documented *there*, but whatever) indicates that it
> is indeed possible for the pretend region to be discontiguous from the
> rest of the args. If they're discontiguous, then your change is clearly
> necessary. And, if someone wants to add a target hook to say that these
> two regions are contiguous, then they can do that, and conditionalize
> your change on that. Can you, by chance, confirm that the regions were
> not contiguous on the machine you were working with?
No, that's not right. This patch was for a problem found on ARM
targets, and it is contiguous. The problem is that the space is
"pretend". It's allocated by the called function, not by the caller,
so it must be cleaned up before we leave this function or the stack
pointer will be corrupted. Therefore it can not be used for outgoing
Therefore the existing comment is right. It could be extended to:
/* If this function requires more stack slots than the current
function, we cannot change it into a sibling call.
current_function_pretend_args_size is not part of the
stack allocated by our caller. */
OK with that change instead?