X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Ftree-ssa-copy.c;h=88972750b04f1b589f391db5941cf6aece4b9d7e;hb=17da03727510169106ad60647ac9b2862e151229;hp=c82943c47aa1404f05e4fb96e1c0bec1fd8bef53;hpb=82f6f8b42d34358c3b3ef1b1b13accca4b702118;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index c82943c47aa..88972750b04 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -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); }