On Tue, May 8, 2018 at 5:21 PM, Jakub Jelinek <ja...@redhat.com> wrote: > Hi! > > Since r247992 the cmpelim pass optimizes a few arithmetics with following > comparisons and some of the peephole2s we have to recognize RMW instructions > with comparisons don't trigger anymore. > In particular, on the pr49095.c testcase in GCC 7 only 8 functions used > load + comparison with arith + store ([fh]*xor, something to look at later), > while in GCC 8/9 21 further functions do that. This patch restores it to > the GCC 7 counts. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > What about GCC 8.2? > > 2018-05-08 Jakub Jelinek <ja...@redhat.com> > > PR target/85683 > * config/i386/i386.md: Add peepholes for mem {+,-,&,|,^}= x; mem != 0 > after cmpelim optimization. > > * gcc.target/i386/pr49095.c: Add -masm=att to dg-options. Add > scan-assembler-times checking that except for [fh]*xor other functions > don't use any load instructions.
OK for mainline and backport. Thanks, Uros.