https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90418

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Iain Sandoe from comment #4)
> (In reply to Jakub Jelinek from comment #3)
> > (In reply to Iain Sandoe from comment #2)
> > > (In reply to Jakub Jelinek from comment #1)
> 
> > Though, I don't understand why that
> > if (DEFAULT_ABI == ABI_DARWIN && crtl->calls_eh_return) return false;
> > wouldn't work in rs6000_function_ok_for_sibcall, because that conditional
> > should make sure we don't have any tail calls in such functions and thus the
> > above shouldn't trigger.
> 
> Agreed, and that's exactly the code I have present, and I just did a clean
> build.  However, as you suspect the sibcall is still present. Perhaps
> crtl->calls_eh_return is not somehow set or somehow a sib call is generated
> without checking it's OK.  Will look more later.

Hm. So it seems that the problem is in expand - the call to
rs6000_function_ok_for_sibcall() occurs when the tail call is encountered, but
that is before the call to expand_eh_return() - which sets
crtl->calls_eh_return.

If I jam sibcalls off completely, of course, it works.

Trying the posted patch for gcc/tree-tailcall.c

Reply via email to