OSDN Git Service

Fix long line
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-copy.c
index c82943c..8897275 100644 (file)
@@ -191,7 +191,10 @@ propagate_value (use_operand_p op_p, tree val)
 
    Use this version when not const/copy propagating values.  For example,
    PRE uses this version when building expressions as they would appear
-   in specific blocks taking into account actions of PHI nodes.  */
+   in specific blocks taking into account actions of PHI nodes.
+
+   The statement in which an expression has been replaced should be
+   folded using fold_stmt_inplace.  */
 
 void
 replace_exp (use_operand_p op_p, tree val)
@@ -211,12 +214,10 @@ replace_exp (use_operand_p op_p, tree val)
 void
 propagate_tree_value (tree *op_p, tree val)
 {
-#if defined ENABLE_CHECKING
-  gcc_assert (!(TREE_CODE (val) == SSA_NAME
-                && *op_p
-               && TREE_CODE (*op_p) == SSA_NAME
-               && !may_propagate_copy (*op_p, val)));
-#endif
+  gcc_checking_assert (!(TREE_CODE (val) == SSA_NAME
+                        && *op_p
+                        && TREE_CODE (*op_p) == SSA_NAME
+                        && !may_propagate_copy (*op_p, val)));
 
   if (TREE_CODE (val) == SSA_NAME)
     *op_p = val;
@@ -248,7 +249,7 @@ propagate_tree_value_into_stmt (gimple_stmt_iterator *gsi, tree val)
   else if (gimple_code (stmt) == GIMPLE_COND)
     {
       tree lhs = NULL_TREE;
-      tree rhs = fold_convert (TREE_TYPE (val), integer_zero_node);
+      tree rhs = build_zero_cst (TREE_TYPE (val));
       propagate_tree_value (&lhs, val);
       gimple_cond_set_code (stmt, NE_EXPR);
       gimple_cond_set_lhs (stmt, lhs);
@@ -777,7 +778,9 @@ fini_copy_prop (void)
        duplicate_ssa_name_ptr_info (copy_of[i].value, SSA_NAME_PTR_INFO (var));
     }
 
-  substitute_and_fold (get_value, NULL, true);
+  /* Don't do DCE if we have loops.  That's the simplest way to not
+     destroy the scev cache.  */
+  substitute_and_fold (get_value, NULL, !current_loops);
 
   free (copy_of);
 }