This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Sparc tail calls (take 4)
- To: Jakub Jelinek <jakub at redhat dot com>
- Subject: Re: [PATCH] Sparc tail calls (take 4)
- From: Richard Henderson <rth at cygnus dot com>
- Date: Fri, 24 Mar 2000 11:25:26 -0800
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20000324122942.A555@mff.cuni.cz>
On Fri, Mar 24, 2000 at 12:29:42PM +0100, Jakub Jelinek wrote:
> First: in calls.c I had to add following code:
> + if (args_size.constant > current_function_args_size)
> + {
> + /* If this function requires more stack slots than the current
> + function, we cannot change it into a sibling call. */
> + sibcall_failure = 1;
> + }
I could have sworn this check was already in there, but
I see that it isn't. Oops. This must have been causing
all sorts of havock.
> in mark_jump_label I just scan the normal call chain, is it necessary to
> scan the other chains as well?
I would to be safe. There's the issue of the tail recursion
label at least.
> calls.c generic code requires fndecl to be non-NULL. Is fndecl NULL only for
> indirect calls? If yes, then IMHO that test should go into the arch specific
> FUNCTION_OK_FOR_SIBCALL macro...
I agree. In one of the changes to that section of code I was
making last night, I added commentary to the effect that it
could be handled on a per-target basis.
> + /* Look at the Normal call sequence attached to the CALL_PLACEHOLDER. */
> + case CALL_PLACEHOLDER:
> + for (insn = XEXP (x, 0); insn; insn = NEXT_INSN (insn))
> + if (GET_RTX_CLASS (GET_CODE (insn)) == 'i')
> + mark_jump_label (PATTERN (insn), NULL_RTX, cross_jump, 0);
Change this to scan all three sequences, and the patch is ok.
r~