PR tree-optimization/25248
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Dec 2005 09:34:26 +0000 (09:34 +0000)
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Dec 2005 09:34:26 +0000 (09:34 +0000)
* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Do not use
evolution_of_loop from the failed attempt.  Remove handling
of MULT_EXPR.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108225 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-scalar-evolution.c

index e67b713..83df5d9 100644 (file)
@@ -1,3 +1,10 @@
+2005-12-08  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       PR tree-optimization/25248
+       * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Do not use
+       evolution_of_loop from the failed attempt.  Remove handling
+       of MULT_EXPR.
+
 2005-12-08  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * tree.h (DECL_EXTERNAL): Clarify documentation.
index c35298e..bd15ae9 100644 (file)
@@ -1042,6 +1042,7 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
   t_bool res = t_false;
   tree rhs0, rhs1;
   tree type_rhs = TREE_TYPE (rhs);
+  tree evol;
   
   /* The RHS is one of the following cases:
      - an SSA_NAME, 
@@ -1084,14 +1085,15 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
            {
              /* Match an assignment under the form: 
                 "a = b + c".  */
+             evol = *evolution_of_loop;
              res = follow_ssa_edge 
                (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, 
-                evolution_of_loop, limit);
+                &evol, limit);
              
              if (res == t_true)
                *evolution_of_loop = add_to_evolution 
                  (loop->num, 
-                  chrec_convert (type_rhs, *evolution_of_loop, at_stmt), 
+                  chrec_convert (type_rhs, evol, at_stmt), 
                   PLUS_EXPR, rhs1);
              
              else if (res == t_false)
@@ -1186,68 +1188,6 @@ follow_ssa_edge_in_rhs (struct loop *loop, tree at_stmt, tree rhs,
       
       break;
     
-    case MULT_EXPR:
-      /* This case is under the form "opnd0 = rhs0 * rhs1".  */
-      rhs0 = TREE_OPERAND (rhs, 0);
-      rhs1 = TREE_OPERAND (rhs, 1);
-      STRIP_TYPE_NOPS (rhs0);
-      STRIP_TYPE_NOPS (rhs1);
-
-      if (TREE_CODE (rhs0) == SSA_NAME)
-       {
-         if (TREE_CODE (rhs1) == SSA_NAME)
-           {
-             /* Match an assignment under the form: 
-                "a = b * c".  */
-             res = follow_ssa_edge 
-               (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, 
-                evolution_of_loop, limit);
-             
-             if (res == t_true || res == t_dont_know)
-               *evolution_of_loop = chrec_dont_know;
-             
-             else if (res == t_false)
-               {
-                 res = follow_ssa_edge 
-                   (loop, SSA_NAME_DEF_STMT (rhs1), halting_phi, 
-                    evolution_of_loop, limit);
-                 
-                 if (res == t_true || res == t_dont_know)
-                   *evolution_of_loop = chrec_dont_know;
-               }
-           }
-         
-         else
-           {
-             /* Match an assignment under the form: 
-                "a = b * ...".  */
-             res = follow_ssa_edge 
-               (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, 
-                evolution_of_loop, limit);
-             if (res == t_true || res == t_dont_know)
-               *evolution_of_loop = chrec_dont_know;
-           }
-       }
-      
-      else if (TREE_CODE (rhs1) == SSA_NAME)
-       {
-         /* Match an assignment under the form: 
-            "a = ... * c".  */
-         res = follow_ssa_edge 
-           (loop, SSA_NAME_DEF_STMT (rhs1), halting_phi, 
-            evolution_of_loop, limit);
-         if (res == t_true || res == t_dont_know)
-           *evolution_of_loop = chrec_dont_know;
-       }
-      
-      else
-       /* Otherwise, match an assignment under the form: 
-          "a = ... * ...".  */
-       /* And there is nothing to do.  */
-       res = t_false;
-      
-      break;
-
     case ASSERT_EXPR:
       {
        /* This assignment is of the form: "a_1 = ASSERT_EXPR <a_2, ...>"