diff options
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r-- | gcc/tree-ssa-propagate.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index b787aae..49277a0 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -1176,6 +1176,9 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p) && TREE_CODE (GIMPLE_STMT_OPERAND (stmt, 1)) == ASSERT_EXPR) continue; + /* Record the state of the statement before replacements. */ + push_stmt_changes (bsi_stmt_ptr (i)); + /* Replace the statement with its folded version and mark it folded. */ did_replace = false; @@ -1211,10 +1214,6 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p) fold_stmt (bsi_stmt_ptr (i)); stmt = bsi_stmt (i); - /* If we folded a builtin function, we'll likely - need to rename VDEFs. */ - mark_new_vars_to_rename (stmt); - /* If we cleaned up EH information from the statement, remove EH edges. */ if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt)) @@ -1232,6 +1231,14 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p) print_generic_stmt (dump_file, stmt, TDF_SLIM); fprintf (dump_file, "\n"); } + + /* Determine what needs to be done to update the SSA form. */ + pop_stmt_changes (bsi_stmt_ptr (i)); + } + else + { + /* The statement was not modified, discard the change buffer. */ + discard_stmt_changes (bsi_stmt_ptr (i)); } /* Some statements may be simplified using ranges. For @@ -1242,7 +1249,6 @@ substitute_and_fold (prop_value_t *prop_value, bool use_ranges_p) statement. */ if (use_ranges_p) simplify_stmt_using_ranges (stmt); - } } |