re PR c++/55137 (Unexpected static structure initialization)
authorJakub Jelinek <jakub@redhat.com>
Thu, 6 Dec 2012 14:37:09 +0000 (15:37 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 6 Dec 2012 14:37:09 +0000 (15:37 +0100)
commit5442fe4818ecb877fccbba726ded41f1de3583c6
tree69d8a57a66b0f88599b49c7300a7e116451e88ce
parentd8169a0d2a030e0b25fc545f535328b5adfaadec
re PR c++/55137 (Unexpected static structure initialization)

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.

From-SVN: r194250
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]