From c0c123ef5222b0e12a5984640f0dd4db4ada569c Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 1 Aug 2013 15:24:49 +0200 Subject: cgraph.c (cgraph_release_function_body): Use used_as_abstract_origin. * cgraph.c (cgraph_release_function_body): Use used_as_abstract_origin. (cgraph_release_function_body): Likewise. (cgraph_can_remove_if_no_direct_calls_p): Likewise. * cgraph.h (cgrpah_node): Rename abstract_and_needed to used_as_abstract_origin. * tree-inline-transfrom.c (can_remove_node_now_p_1): Do not remove symbols used as abstract origins. * cgraphunit.c (analyze_functions): Update. * ipa.c (symtab_remove_unreachable_nodes): Recompute used_as_abstract_origin. * tree-inline.c (tree_function_versioning): Update used_as_abstract_origin; be ready for DECL_RESULT and DECL_ARGUMENTS to be NULL. * lto-symtab.c (lto_symtab_merge_symbols): Merge duplicated nodes for abstract functions. * cgraph.h (symtab_real_symbol_p): Abstract declarations are not real symbols. From-SVN: r201408 --- gcc/tree-inline.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/tree-inline.c') diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 9b2c815..be3917a 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -5085,6 +5085,8 @@ tree_function_versioning (tree old_decl, tree new_decl, DECL_ARTIFICIAL (new_decl) = 1; DECL_ABSTRACT_ORIGIN (new_decl) = DECL_ORIGIN (old_decl); + if (DECL_ORIGIN (old_decl) == old_decl) + old_version_node->used_as_abstract_origin = true; DECL_FUNCTION_PERSONALITY (new_decl) = DECL_FUNCTION_PERSONALITY (old_decl); /* Prepare the data structures for the tree copy. */ @@ -5122,6 +5124,8 @@ tree_function_versioning (tree old_decl, tree new_decl, old_entry_block = ENTRY_BLOCK_PTR_FOR_FUNCTION (DECL_STRUCT_FUNCTION (old_decl)); + DECL_RESULT (new_decl) = DECL_RESULT (old_decl); + DECL_ARGUMENTS (new_decl) = DECL_ARGUMENTS (old_decl); initialize_cfun (new_decl, old_decl, old_entry_block->count); DECL_STRUCT_FUNCTION (new_decl)->gimple_df->ipa_pta -- cgit v1.1