This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/68067] [4.9/5 Regression] Wrong constant folding
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 28 Oct 2015 10:01:55 +0000
- Subject: [Bug middle-end/68067] [4.9/5 Regression] Wrong constant folding
- Auto-submitted: auto-generated
- References: <bug-68067-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68067
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Wed Oct 28 10:01:23 2015
New Revision: 229479
URL: https://gcc.gnu.org/viewcvs?rev=229479&root=gcc&view=rev
Log:
2015-10-28 Richard Biener <rguenther@suse.de>
PR middle-end/68067
* fold-const.c (negate_expr_p): We cannot negate plus or minus
if overflow is not wrapping. Likewise multiplication unless
one operand is constant and not power of two.
(fold_negate_expr): Adjust accordingly.
* gcc.dg/torture/pr68067-1.c: New testcase.
* gcc.dg/torture/pr68067-2.c: Likewise.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr68067-1.c
trunk/gcc/testsuite/gcc.dg/torture/pr68067-2.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog