Message ID | 5411A2A6.1030303@codesourcery.com |
---|---|
State | New |
Headers | show |
On 09/11/2014 03:24 PM, Bernd Schmidt wrote: > The nvptx backend is somewhat unusual in that call insns set a pseudo. > The combiner is surprised by this and allows combining them into other > insns, which remain as INSN rather than CALL_INSN. Aborts ensue. > > Bootstrapped and tested on x86_64-linux, together with the other > patches. Ok? Ping. Bernd
On 09/11/14 07:24, Bernd Schmidt wrote: > The nvptx backend is somewhat unusual in that call insns set a pseudo. > The combiner is surprised by this and allows combining them into other > insns, which remain as INSN rather than CALL_INSN. Aborts ensue. > > Bootstrapped and tested on x86_64-linux, together with the other > patches. Ok? OK. jeff
On Thu, Sep 11, 2014 at 03:24:54PM +0200, Bernd Schmidt wrote: > The nvptx backend is somewhat unusual in that call insns set a pseudo. > The combiner is surprised by this and allows combining them into other > insns, which remain as INSN rather than CALL_INSN. Aborts ensue. distribute_notes has code for when I2 is a CALL. This suggests that on some other targets there can be useful combinations made, so it isn't in that case terribly nice to disable all combinations with CALLs as I0 or I1 or I2. Or it's dead code :-) Segher
On 10/30/14 11:36, Segher Boessenkool wrote: > On Thu, Sep 11, 2014 at 03:24:54PM +0200, Bernd Schmidt wrote: >> The nvptx backend is somewhat unusual in that call insns set a pseudo. >> The combiner is surprised by this and allows combining them into other >> insns, which remain as INSN rather than CALL_INSN. Aborts ensue. > > distribute_notes has code for when I2 is a CALL. This suggests that > on some other targets there can be useful combinations made, so it > isn't in that case terribly nice to disable all combinations with CALLs > as I0 or I1 or I2. > > Or it's dead code :-) Most likely it's dead code. jeff
On 10/30/2014 06:36 PM, Segher Boessenkool wrote: > On Thu, Sep 11, 2014 at 03:24:54PM +0200, Bernd Schmidt wrote: >> The nvptx backend is somewhat unusual in that call insns set a pseudo. >> The combiner is surprised by this and allows combining them into other >> insns, which remain as INSN rather than CALL_INSN. Aborts ensue. > > distribute_notes has code for when I2 is a CALL. This suggests that > on some other targets there can be useful combinations made, so it > isn't in that case terribly nice to disable all combinations with CALLs > as I0 or I1 or I2. > > Or it's dead code :-) I suspect the latter. As far as I can tell the patch does not change code generation on x86_64 at least (on a large set of input files including gcc, spec2k and linux-kernel). Bernd
* combine.c (try_combine): Don't allow a call as one of the source insns. diff --git a/gcc/combine.c b/gcc/combine.c index 0ec7f85..fe95b41 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2543,7 +2543,10 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, rtx_insn *i0, /* Exit early if one of the insns involved can't be used for combinations. */ - if (cant_combine_insn_p (i3) + if (CALL_P (i2) + || (i1 && CALL_P (i1)) + || (i0 && CALL_P (i0)) + || cant_combine_insn_p (i3) || cant_combine_insn_p (i2) || (i1 && cant_combine_insn_p (i1)) || (i0 && cant_combine_insn_p (i0))