http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52976

--- Comment #4 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2012-04-13 
20:46:27 UTC ---
Here's a patch that fixes the reduced test case but is otherwise untested.  I
don't know what "the polyhedron tests aermod.490 and doduc.f90" are; I don't
find them in the gcc testsuite.  Dominique, can you please try this patch on
those?  I will do some regression testing and try the patch out on SPEC in the
meanwhile.

Index: gcc/tree-ssa-reassoc.c
===================================================================
--- gcc/tree-ssa-reassoc.c    (revision 186393)
+++ gcc/tree-ssa-reassoc.c    (working copy)
@@ -1200,6 +1200,7 @@ undistribute_ops_list (enum tree_code opcode,
       dcode = gimple_assign_rhs_code (oe1def);
       if ((dcode != MULT_EXPR
        && dcode != RDIV_EXPR)
+      || oe1->count != 1
       || !is_reassociable_op (oe1def, dcode, loop))
     continue;

@@ -1243,6 +1244,8 @@ undistribute_ops_list (enum tree_code opcode,
       oecount c;
       void **slot;
       size_t idx;
+      if (oe1->count != 1)
+        continue;
       c.oecode = oecode;
       c.cnt = 1;
       c.id = next_oecount_id++;
@@ -1311,7 +1314,7 @@ undistribute_ops_list (enum tree_code opcode,

       FOR_EACH_VEC_ELT (operand_entry_t, subops[i], j, oe1)
         {
-          if (oe1->op == c->op)
+          if (oe1->op == c->op && oe1->count == 1)
         {
           SET_BIT (candidates2, i);
           ++nr_candidates2;

Reply via email to