re PR middle-end/49958 (fold performs invalid association)
authorRichard Guenther <rguenther@suse.de>
Wed, 3 Aug 2011 13:33:28 +0000 (13:33 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 3 Aug 2011 13:33:28 +0000 (13:33 +0000)
commita130fb24411061b0edf14203bd76ff1c3aad89b8
tree8d726f330bfaa34d014e6f7a8736038a869c9858
parentf77b022b82d2ff2a4859b2dab1f58c97ce0d1b51
re PR middle-end/49958 (fold performs invalid association)

2011-08-03  Richard Guenther  <rguenther@suse.de>

PR middle-end/49958
* fold-const.c (fold_binary_loc): Only associate
(+ (+ (* a b) c) (* d e)) as (+ (+ (* a b) (* d e)) c) if
overflow wraps.

        * gcc.dg/torture/pr49958.c: New testcase.

From-SVN: r177270
gcc/ChangeLog
gcc/fold-const.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr49958.c [new file with mode: 0644]