Hi! I was worried this patch would prevent too many other optimisations, so I looked into better options. I didn't find any. I tested the effects of the patch on 31 architectures (building GCC and then Linux with it; 6 errored out building the kernel). There were exactly zero differences in generated code.
The patch is fine for mainline. Thanks Bin! Segher On Thu, Dec 01, 2016 at 09:47:51AM +0000, Bin Cheng wrote: > 2016-12-01 Bin Cheng <bin.ch...@arm.com> > > PR rtl-optimization/78559 > * combine.c (try_combine): Discard REG_EQUAL and REG_EQUIV for > other_insn in combine. > diff --git a/gcc/combine.c b/gcc/combine.c > index 22fb7a9..93b0901 100644 > --- a/gcc/combine.c > +++ b/gcc/combine.c > @@ -4138,7 +4138,9 @@ try_combine (rtx_insn *i3, rtx_insn *i2, rtx_insn *i1, > rtx_insn *i0, > PATTERN (undobuf.other_insn))) > ||(REG_NOTE_KIND (note) == REG_UNUSED > && !reg_set_p (XEXP (note, 0), > - PATTERN (undobuf.other_insn)))) > + PATTERN (undobuf.other_insn))) > + || REG_NOTE_KIND (note) == REG_EQUAL > + || REG_NOTE_KIND (note) == REG_EQUIV) > remove_note (undobuf.other_insn, note); > }