[Bug tree-optimization/80281] [5/6/7 Regression] Wrong constant folding
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 4 09:06:00 GMT 2017
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
More information about the Gcc-bugs
mailing list