diff options
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 609a081..e1e1f11 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1297,6 +1297,14 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) else walk_gimple_op (copy, remap_gimple_op_r, &wi); + /* Clear the copied virtual operands. We are not remapping them here + but are going to recreate them from scratch. */ + if (gimple_has_mem_ops (copy)) + { + gimple_set_vdef (copy, NULL_TREE); + gimple_set_vuse (copy, NULL_TREE); + } + /* We have to handle EH region remapping of GIMPLE_RESX specially because the region number is not an operand. */ if (gimple_code (stmt) == GIMPLE_RESX && id->eh_region_offset) @@ -3410,6 +3418,9 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) pointer_map_destroy (id->decl_map); id->decl_map = st; + /* Unlink the calls virtual operands before replacing it. */ + unlink_stmt_vdef (stmt); + /* If the inlined function returns a result that we care about, substitute the GIMPLE_CALL with an assignment of the return variable to the LHS of the call. That is, if STMT was @@ -3420,10 +3431,7 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) stmt = gimple_build_assign (gimple_call_lhs (stmt), use_retvar); gsi_replace (&stmt_gsi, stmt, false); if (gimple_in_ssa_p (cfun)) - { - update_stmt (stmt); - mark_symbols_for_renaming (stmt); - } + mark_symbols_for_renaming (stmt); maybe_clean_or_replace_eh_stmt (old_stmt, stmt); } else @@ -3443,7 +3451,6 @@ expand_call_inline (basic_block bb, gimple stmt, copy_body_data *id) undefined via a move. */ stmt = gimple_build_assign (gimple_call_lhs (stmt), def); gsi_replace (&stmt_gsi, stmt, true); - update_stmt (stmt); } else { @@ -4451,28 +4458,16 @@ tree_function_versioning (tree old_decl, tree new_decl, varray_type tree_map, /* Clean up. */ pointer_map_destroy (id.decl_map); + free_dominance_info (CDI_DOMINATORS); + free_dominance_info (CDI_POST_DOMINATORS); if (!update_clones) { fold_marked_statements (0, id.statements_to_fold); pointer_set_destroy (id.statements_to_fold); fold_cond_expr_cond (); - } - if (gimple_in_ssa_p (cfun)) - { - free_dominance_info (CDI_DOMINATORS); - free_dominance_info (CDI_POST_DOMINATORS); - if (!update_clones) - delete_unreachable_blocks (); + delete_unreachable_blocks (); update_ssa (TODO_update_ssa); - if (!update_clones) - { - fold_cond_expr_cond (); - if (need_ssa_update_p ()) - update_ssa (TODO_update_ssa); - } } - free_dominance_info (CDI_DOMINATORS); - free_dominance_info (CDI_POST_DOMINATORS); VEC_free (gimple, heap, init_stmts); pop_cfun (); current_function_decl = old_current_function_decl; |