https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85588
--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Thu Jun 21 09:50:36 2018 New Revision: 261839 URL: https://gcc.gnu.org/viewcvs?rev=261839&root=gcc&view=rev Log: 2018-06-21 Richard Biener <rguent...@suse.de> Backport from mainline 2018-02-28 Richard Biener <rguent...@suse.de> PR middle-end/84607 * genmatch.c (capture_info::walk_match): Do not mark captured expressions without operands as expr_p given they act more like predicates and should be subject to "lost tail" side-effect preserving. * gcc.dg/pr84607.c: New testcase. 2018-05-04 Richard Biener <rguent...@suse.de> PR middle-end/85588 * fold-const.c (negate_expr_p): Restrict negation of operand zero of a division to when we know that can happen without overflow. (fold_negate_expr_1): Likewise. * gcc.dg/torture/pr85588.c: New testcase. * gcc.dg/torture/pr57656.c: Use dg-additional-options. Added: branches/gcc-6-branch/gcc/testsuite/gcc.dg/pr84607.c branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr85588.c Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/fold-const.c branches/gcc-6-branch/gcc/genmatch.c branches/gcc-6-branch/gcc/testsuite/ChangeLog branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr57656.c