diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
commit | e252b51ccde010cbd2a146485d8045103cd99533 (patch) | |
tree | e060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/cgraph.c | |
parent | f10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff) | |
parent | 104c05c5284b7822d770ee51a7d91946c7e56d50 (diff) | |
download | gcc-e252b51ccde010cbd2a146485d8045103cd99533.zip gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2 |
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index 8014075..8f3af00 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -1506,8 +1506,6 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e) } clone_info *callee_info = clone_info::get (e->callee); - clone_info *caller_info = clone_info::get (e->caller); - if (symtab->dump_file) { fprintf (symtab->dump_file, "updating call of %s -> %s: ", @@ -1515,18 +1513,6 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e) print_gimple_stmt (symtab->dump_file, e->call_stmt, 0, dump_flags); if (callee_info && callee_info->param_adjustments) callee_info->param_adjustments->dump (symtab->dump_file); - unsigned performed_len - = caller_info ? vec_safe_length (caller_info->performed_splits) : 0; - if (performed_len > 0) - fprintf (symtab->dump_file, "Performed splits records:\n"); - for (unsigned i = 0; i < performed_len; i++) - { - ipa_param_performed_split *sm - = &(*caller_info->performed_splits)[i]; - print_node_brief (symtab->dump_file, " dummy_decl: ", sm->dummy_decl, - TDF_UID); - fprintf (symtab->dump_file, ", unit_offset: %u\n", sm->unit_offset); - } } if (ipa_param_adjustments *padjs @@ -1541,10 +1527,7 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e) remove_stmt_from_eh_lp (e->call_stmt); tree old_fntype = gimple_call_fntype (e->call_stmt); - new_stmt = padjs->modify_call (e->call_stmt, - caller_info - ? caller_info->performed_splits : NULL, - e->callee->decl, false); + new_stmt = padjs->modify_call (e, false); cgraph_node *origin = e->callee; while (origin->clone_of) origin = origin->clone_of; @@ -1564,6 +1547,9 @@ cgraph_edge::redirect_call_stmt_to_callee (cgraph_edge *e) } else { + if (flag_checking + && !fndecl_built_in_p (e->callee->decl, BUILT_IN_UNREACHABLE)) + ipa_verify_edge_has_no_modifications (e); new_stmt = e->call_stmt; gimple_call_set_fndecl (new_stmt, e->callee->decl); update_stmt_fn (DECL_STRUCT_FUNCTION (e->caller->decl), new_stmt); @@ -1860,6 +1846,17 @@ cgraph_node::release_body (bool keep_arguments) lto_free_function_in_decl_state_for_node (this); lto_file_data = NULL; } + if (flag_checking && clones) + { + /* It is invalid to release body before materializing clones except + for thunks that don't really need a body. Verify also that we do + not leak pointers to the call statements. */ + for (cgraph_node *node = clones; node; + node = node->next_sibling_clone) + gcc_assert (node->thunk && !node->callees->call_stmt); + } + remove_callees (); + remove_all_references (); } /* Remove function from symbol table. */ @@ -3063,10 +3060,10 @@ collect_callers_of_node_1 (cgraph_node *node, void *data) /* Collect all callers of cgraph_node and its aliases that are known to lead to cgraph_node (i.e. are not overwritable). */ -vec<cgraph_edge *> +auto_vec<cgraph_edge *> cgraph_node::collect_callers (void) { - vec<cgraph_edge *> redirect_callers = vNULL; + auto_vec<cgraph_edge *> redirect_callers; call_for_symbol_thunks_and_aliases (collect_callers_of_node_1, &redirect_callers, false); return redirect_callers; |