PR c++/55137
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Dec 2012 14:37:09 +0000 (14:37 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Dec 2012 14:37:09 +0000 (14:37 +0000)
commit7e9f37dcf7f0e45f051b518acc14a3c1e143233b
tree69d8a57a66b0f88599b49c7300a7e116451e88ce
parent747f0d2a917dbbd49282158a6e8b331a1364b1d1
PR c++/55137
* fold-const.c (fold_binary_loc) <associate>: Don't introduce
TREE_OVERFLOW through reassociation.  If type doesn't have defined
overflow, but one or both of the operands do, use the wrapping type
for reassociation and only convert to type at the end.

* g++.dg/opt/pr55137.C: New test.
* gcc.c-torture/execute/pr55137.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194250 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr55137.C [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/pr55137.c [new file with mode: 0644]