On Mon, May 14, 2018 at 5:08 PM, Marek Polacek <pola...@redhat.com> wrote: > On Mon, May 14, 2018 at 03:07:54PM +0200, Jakub Jelinek wrote: >> On Mon, May 14, 2018 at 02:54:18PM +0200, Uros Bizjak wrote: >> > > --- gcc/config/i386/i386.md.jj 2018-05-11 18:44:32.000000000 +0200 >> > > +++ gcc/config/i386/i386.md 2018-05-14 13:50:28.100482520 +0200 >> > > @@ -19397,11 +19397,11 @@ >> > > (set (match_dup 0) (match_dup 2))]) >> > > (set (match_dup 1) (match_dup 0))] >> > > "(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ()) >> > > + && GET_CODE (operands[2]) != MINUS >> > >> > && COMMUTATIVE_ARITH_P (operands[2]) >> >> That works, but then we should change the peephole2 above it as well. >> MINUS is the only non-commutative plusminuslogic_operator, so it doesn't >> change any behavior. >> >> BTW, wonder if we shouldn't allow giving peephole2's a name, it is too hard >> to refer to them... > > It might be too late but I've regtested/bootstrapped this patch on > x86_64-linux.
Also works for me. Committed to mainline SVN. Uros.