2017-04-04 Richard Biener <rguenther@suse.de>
commit2bbfc137c7356eda3d220ce8e28a54cada3dafe1
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Apr 2017 09:06:04 +0000 (4 09:06 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 4 Apr 2017 09:06:04 +0000 (4 09:06 +0000)
tree46598b536dd7896cb9ef0ba26970bcac31af8696
parent975f273f4960536cbec522a86c96e67bb7a412e5
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246674 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/match.pd
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr80281.c [new file with mode: 0644]