On Wed, Sep 23, 2020 at 10:00:01AM +0930, Alan Modra wrote:
> Hi Segher,
> 
> On Tue, Sep 22, 2020 at 06:59:42PM -0500, Segher Boessenkool wrote:
> > On Tue, Sep 22, 2020 at 09:55:12AM +0930, Alan Modra wrote:
> > >    if (!info->push_p)
> > > -    return;
> > > +    {
> > > +      /* We need the -fsplit-stack prologue for functions that make
> > > +  tail calls.  Tail calls don't count against crtl->is_leaf.  */
> > > +      for (insn = get_topmost_sequence ()->first; insn; insn = NEXT_INSN 
> > > (insn))
> > > + if (CALL_P (insn))
> > > +   break;
> > > +      if (!insn)
> > > + return;
> > > +    }
> > 
> > I don't think that get_topmost_sequence is correct.
> 
> We get here from inside a sequence so we definitely need a way to look
> at the function RTL rather than the empty sequence.  You want
> push_topmost_sequence / pop_topmost_sequence around the rtl scan?

That will not help I think.

It isn't obvious that the outer sequence is always what we want.  If
there is some nicer way to get at the info you want, that would help.

But, this is the expander only -- so I guess we are okay here, it is
much limited when we can be called here.  Add a comment though?

> I wasn't aware there was a need for that when not emitting insns.  And
> can't see any reason why when I look carefully, except that seems to
> be customary, grep only shows one other place using
> get_topmost_sequence as I did.

Yes, and not in a widely used target.  So I wonder if there is some less
tricky way to get at the wanted info?


Segher

Reply via email to