This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Sparc tail calls (take 4)


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~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]