This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/80281] [5/6/7 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: Tue, 04 Apr 2017 09:06:36 +0000
- Subject: [Bug tree-optimization/80281] [5/6/7 Regression] Wrong constant folding
- Auto-submitted: auto-generated
- References: <bug-80281-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80281
--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
Author: rguenth
Date: Tue Apr 4 09:06:04 2017
New Revision: 246674
URL: https://gcc.gnu.org/viewcvs?rev=246674&root=gcc&view=rev
Log:
2017-04-04 Richard Biener <rguenther@suse.de>
PR middle-end/80281
* match.pd (A + (-B) -> A - B): Make sure to preserve unsigned
arithmetic done for the negate or the plus. Simplify.
(A - (-B) -> A + B): Likewise.
* fold-const.c (split_tree): Make sure to not negate pointers.
* gcc.dg/torture/pr80281.c: New testcase.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr80281.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/match.pd
trunk/gcc/testsuite/ChangeLog