From bd3cdcc0872c2ce75d82ecc5a426cb3ace641d0f Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 13 May 2010 08:13:46 +0200 Subject: cgraph.c (cgraph_mark_address_taken_node): No longer imply needed flag. * cgraph.c (cgraph_mark_address_taken_node): No longer imply needed flag. * cgraph.h (cgraph_only_called_directly_p, cgraph_can_remove_if_no_direct_calls_p): test address_taken flag. (cgraph_can_remove_if_no_direct_calls_and_refs_p): New function. * cgraphunit.c (cgraph_mark_functions_to_output): Test address_taken. (assemble * ipa.c (cgraph_remove_unreachable_nodes): Use cgraph_can_remove_if_no_direct_calls_and_refs_p; clear address_taken flags. * tree-inline.c (copy_bb): Check address_taken flag. * tree-profile.c (tree_gen_ic_func_profiler): Check address_taken and externally_visible flag. * tree-ssa/unreachable.c: New test. From-SVN: r159354 --- gcc/cgraph.h | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'gcc/cgraph.h') diff --git a/gcc/cgraph.h b/gcc/cgraph.h index dbfc89f..1ccae09 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -856,19 +856,28 @@ varpool_node_set_nonempty_p (varpool_node_set set) static inline bool cgraph_only_called_directly_p (struct cgraph_node *node) { - return !node->needed && !node->local.externally_visible; + return !node->needed && !node->address_taken && !node->local.externally_visible; } /* Return true when function NODE can be removed from callgraph if all direct calls are eliminated. */ static inline bool -cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node) +cgraph_can_remove_if_no_direct_calls_and_refs_p (struct cgraph_node *node) { return (!node->needed && !node->reachable_from_other_partition && (DECL_COMDAT (node->decl) || !node->local.externally_visible)); } +/* Return true when function NODE can be removed from callgraph + if all direct calls are eliminated. */ + +static inline bool +cgraph_can_remove_if_no_direct_calls_p (struct cgraph_node *node) +{ + return !node->address_taken && cgraph_can_remove_if_no_direct_calls_and_refs_p (node); +} + /* Constant pool accessor function. */ htab_t constant_pool_htab (void); -- cgit v1.1