[Bug rtl-optimization/69246] [6 Regression] ICE in distribute_notes, at combine.c:13693 on i686-linux-gnu

rsandifo at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 12 20:06:00 GMT 2016


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

--- Comment #8 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> ---
(In reply to rsandifo@gcc.gnu.org from comment #7)
> I think the problem with the old code was that we were using
> a non-sibcall expander for an ECF_SIBCALL call.  I.e. we generated
> an insn that had the stack adjustment, was marked SIBLING_CALL_P,
> and matched *sibcall_pop, but we generated it through call_pop
> rather than (the nonexistent) sibcall_pop.
> 
> Perhaps I should instead have kept the calls.c support for
> sibcall_pop and sibcall_value_pop and defined corresponding
> expanders for x86.

Hmm, now I'm not so sure.  Defining and using sibcall(_value)_pop
does fix the bug, but it prevents the frame pointer from being
eliminated, whereas call_pop exists for precisely the opposite
reason:

  For machines where @code{RETURN_POPS_ARGS} can be nonzero, the use of these
  patterns increases the number of functions for which the frame pointer
  can be eliminated, if desired.

So with current trunk we get a plain jump:

foo:
        jmp     *a

whereas using *sibcall(_value)_pop gives:

foo:
        pushl   %ebp
        movl    %esp, %ebp
        leave
        jmp     *a

(like the pre-patch compiler).  So maybe we should go with Segher's patch
and delete the *sibcall(_value)_pop patterns?


More information about the Gcc-bugs mailing list