https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85756
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Wed May 30 07:35:48 2018 New Revision: 260918 URL: https://gcc.gnu.org/viewcvs?rev=260918&root=gcc&view=rev Log: Backported from mainline 2018-05-14 Jakub Jelinek <ja...@redhat.com> PR target/85756 * config/i386/i386.md: Disallow non-commutative arithmetics in last twpeephole for mem {+,-,&,|,^}= x; mem != 0 after cmpelim optimization. Use COMMUTATIVE_ARITH_P test rather than != MINUS in the peephole2 before it. * gcc.c-torture/execute/pr85756.c: New test. Added: branches/gcc-8-branch/gcc/testsuite/gcc.c-torture/execute/pr85756.c Modified: branches/gcc-8-branch/gcc/ChangeLog branches/gcc-8-branch/gcc/config/i386/i386.md branches/gcc-8-branch/gcc/testsuite/ChangeLog