This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/49958] fold performs invalid association
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 3 Aug 2011 13:33:37 +0000
- Subject: [Bug middle-end/49958] fold performs invalid association
- Auto-submitted: auto-generated
- References: <bug-49958-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49958
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-03 13:33:31 UTC ---
Author: rguenth
Date: Wed Aug 3 13:33:28 2011
New Revision: 177270
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177270
Log:
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.
Added:
trunk/gcc/testsuite/gcc.dg/torture/pr49958.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
trunk/gcc/testsuite/ChangeLog