re PR tree-optimization/80281 (Wrong constant folding)
authorRichard Biener <rguenther@suse.de>
Tue, 4 Apr 2017 09:06:04 +0000 (09:06 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 4 Apr 2017 09:06:04 +0000 (09:06 +0000)
commit248179b5fc812b294e2488b23fedaaabe099ad9d
tree46598b536dd7896cb9ef0ba26970bcac31af8696
parenta577fcf2d5ec9695efb5c086fd328cf378289a55
re PR tree-optimization/80281 (Wrong constant folding)

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.

From-SVN: r246674
gcc/ChangeLog
gcc/fold-const.c
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr80281.c [new file with mode: 0644]