OSDN Git Service

PR tree-optimization/17742
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Nov 2004 20:12:34 +0000 (20:12 +0000)
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 11 Nov 2004 20:12:34 +0000 (20:12 +0000)
* tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle
MINUS_EXPR correctly.

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

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

index 620cefa..7c072a4 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-11  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       PR tree-optimization/17742
+       * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle
+       MINUS_EXPR correctly.
+
 2004-11-11  Sebastian Pop  <pop@cri.ensmp.fr>
 
        * tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi): 
 2004-11-11  Sebastian Pop  <pop@cri.ensmp.fr>
 
        * tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi): 
index e26f1da..21e020d 100644 (file)
@@ -1186,65 +1186,15 @@ follow_ssa_edge_in_rhs (struct loop *loop,
 
       if (TREE_CODE (rhs0) == SSA_NAME)
        {
 
       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);
-             
-             if (res)
-               *evolution_of_loop = add_to_evolution 
-                 (loop->num, chrec_convert (type_rhs, *evolution_of_loop), 
-                  MINUS_EXPR, rhs1);
-             
-             else
-               {
-                 res = follow_ssa_edge 
-                   (loop, SSA_NAME_DEF_STMT (rhs1), halting_phi, 
-                    evolution_of_loop);
-                 
-                 if (res)
-                   *evolution_of_loop = add_to_evolution 
-                     (loop->num, 
-                      chrec_fold_multiply (type_rhs, 
-                                           *evolution_of_loop, 
-                                           build_int_cst_type (type_rhs, -1)),
-                      PLUS_EXPR, rhs0);
-               }
-           }
-         
-         else
-           {
-             /* Match an assignment under the form: 
-                "a = b - ...".  */
-             res = follow_ssa_edge 
-               (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, 
-                evolution_of_loop);
-             if (res)
-               *evolution_of_loop = add_to_evolution 
-                 (loop->num, chrec_convert (type_rhs, *evolution_of_loop), 
-                  MINUS_EXPR, rhs1);
-           }
-       }
-      
-      else if (TREE_CODE (rhs1) == SSA_NAME)
-       {
          /* Match an assignment under the form: 
          /* Match an assignment under the form: 
-            "a = ... - c".  */
-         res = follow_ssa_edge 
-           (loop, SSA_NAME_DEF_STMT (rhs1), halting_phi, 
-            evolution_of_loop);
+            "a = b - ...".  */
+         res = follow_ssa_edge (loop, SSA_NAME_DEF_STMT (rhs0), halting_phi, 
+                                evolution_of_loop);
          if (res)
            *evolution_of_loop = add_to_evolution 
          if (res)
            *evolution_of_loop = add_to_evolution 
-             (loop->num, 
-              chrec_fold_multiply (type_rhs, 
-                                   *evolution_of_loop, 
-                                   build_int_cst_type (type_rhs, -1)),
-              PLUS_EXPR, rhs0);
+                   (loop->num, chrec_convert (type_rhs, *evolution_of_loop), 
+                    MINUS_EXPR, rhs1);
        }
        }
-      
       else
        /* Otherwise, match an assignment under the form: 
           "a = ... - ...".  */
       else
        /* Otherwise, match an assignment under the form: 
           "a = ... - ...".  */