[PATCH] Sparc tail calls (take 4)

Jeffrey A Law law@cygnus.com
Fri Mar 24 11:35:00 GMT 2000


  In message < 20000324112526.B19711@cygnus.com >you write:
  > 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.
A similar check used to be in the code.  Presumably it got lost when you had
to revamp the block note handling:

      if (pass == 0)
        {
          tail_call_insns = insns;
          /* If the current function's argument block is not large enough to
             hold the outoing arguments, then the sibling call failed,
             copy any block notes off the sequence, then zero out the
             sequence.

             Similarly if we encountered some other situation where we
             can not generate a sibling call.  */
          if (current_function_args_size < args_size.constant
              || sibcall_failure)
            {
              reemit_block_notes_from_seq (get_last_insn (), tail_call_insns);
              tail_call_insns = NULL_RTX;
            }

          /* Restore the pending stack adjustment now that we have
             finished generating the sibling call sequence.  */
          pending_stack_adjust = save_pending_stack_adjust;
        }

jeff




More information about the Gcc-patches mailing list