This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/49958] fold performs invalid association


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]