diff options
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r-- | gcc/cgraphunit.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 54752ed54c1..5a69afa5286 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1364,8 +1364,7 @@ thunk_adjust (gimple_stmt_iterator * bsi, vtabletmp2 = create_tmp_var (TREE_TYPE (TREE_TYPE (vtabletmp)), "vtableaddr"); stmt = gimple_build_assign (vtabletmp2, - build1 (INDIRECT_REF, - TREE_TYPE (vtabletmp2), vtabletmp)); + build_simple_mem_ref (vtabletmp)); gsi_insert_after (bsi, stmt, GSI_NEW_STMT); mark_symbols_for_renaming (stmt); find_referenced_vars_in (stmt); @@ -1384,9 +1383,7 @@ thunk_adjust (gimple_stmt_iterator * bsi, vtabletmp3 = create_tmp_var (TREE_TYPE (TREE_TYPE (vtabletmp2)), "vcalloffset"); stmt = gimple_build_assign (vtabletmp3, - build1 (INDIRECT_REF, - TREE_TYPE (vtabletmp3), - vtabletmp2)); + build_simple_mem_ref (vtabletmp2)); gsi_insert_after (bsi, stmt, GSI_NEW_STMT); mark_symbols_for_renaming (stmt); find_referenced_vars_in (stmt); @@ -2128,7 +2125,7 @@ cgraph_copy_node_for_versioning (struct cgraph_node *old_version, new_version->local.local = true; new_version->local.vtable_method = false; new_version->global = old_version->global; - new_version->rtl = new_version->rtl; + new_version->rtl = old_version->rtl; new_version->reachable = true; new_version->count = old_version->count; @@ -2196,7 +2193,6 @@ cgraph_function_versioning (struct cgraph_node *old_version_node, else new_decl = build_function_decl_skip_args (old_decl, args_to_skip); - cgraph_make_decl_local (new_decl); /* Generate a new name for the new version. */ DECL_NAME (new_decl) = clone_function_name (old_decl, clone_name); SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl)); @@ -2345,7 +2341,6 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e) { tree decl = gimple_call_fndecl (e->call_stmt); gimple new_stmt; - gimple_stmt_iterator gsi; #ifdef ENABLE_CHECKING struct cgraph_node *node; #endif @@ -2367,29 +2362,34 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e) cgraph_node_name (e->callee), e->callee->uid); print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags); if (e->callee->clone.combined_args_to_skip) - { - fprintf (cgraph_dump_file, " combined args to skip: "); - dump_bitmap (cgraph_dump_file, e->callee->clone.combined_args_to_skip); + { + fprintf (cgraph_dump_file, " combined args to skip: "); + dump_bitmap (cgraph_dump_file, + e->callee->clone.combined_args_to_skip); } } if (e->callee->clone.combined_args_to_skip) - new_stmt = gimple_call_copy_skip_args (e->call_stmt, - e->callee->clone.combined_args_to_skip); + { + gimple_stmt_iterator gsi; + + new_stmt + = gimple_call_copy_skip_args (e->call_stmt, + e->callee->clone.combined_args_to_skip); + + if (gimple_vdef (new_stmt) + && TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME) + SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt; + + gsi = gsi_for_stmt (e->call_stmt); + gsi_replace (&gsi, new_stmt, true); + } else new_stmt = e->call_stmt; - if (gimple_vdef (new_stmt) - && TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME) - SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt; - gimple_call_set_fndecl (new_stmt, e->callee->decl); - gsi = gsi_for_stmt (e->call_stmt); - gsi_replace (&gsi, new_stmt, true); + gimple_call_set_fndecl (new_stmt, e->callee->decl); update_stmt (new_stmt); - /* Update EH information too, just in case. */ - maybe_clean_or_replace_eh_stmt (e->call_stmt, new_stmt); - cgraph_set_call_stmt_including_clones (e->caller, e->call_stmt, new_stmt); if (cgraph_dump_file) |