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 11:42:29 +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
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011.08.03 11:42:12
CC| |rth at gcc dot gnu.org
AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-03 11:42:12 UTC ---
Done by
/* Reassociate (plus (plus (mult) (foo)) (mult)) as
(plus (plus (mult) (mult)) (foo)) so that we can
take advantage of the factoring cases below. */
if (((TREE_CODE (arg0) == PLUS_EXPR
|| TREE_CODE (arg0) == MINUS_EXPR)
&& TREE_CODE (arg1) == MULT_EXPR)
...
caused by
Tue Aug 24 15:37:03 1999 Richard Henderson <rth@cygnus.com>
* fold-const.c (fold): Reassociate (+ (+ (* a b) c) (* d e))
as (+ (+ (* a b) (* d e)) c). Factor a common power-of-two
multiplicand out of (+ (* a b) (* c d)).
I have a fix.