2015-09-23 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Sep 2015 14:09:48 +0000 (14:09 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Sep 2015 14:09:48 +0000 (14:09 +0000)
commit6c1bd04c3bac12d73baa19d45a13bbf7058ee3ad
tree67581402c59ae589386b720bd313c301e37ab859
parent7013cc711fad7d1186dadc1ab09680bf48da0f4d
2015-09-23   Richard Biener  <rguenther@suse.de>

PR middle-end/67662
* fold-const.c (fold_binary_loc): Do not reassociate two vars with
undefined overflow unless they will cancel out.

* gcc.dg/ubsan/pr67662.c: New testcase.

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