summaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-05-13 08:13:46 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2010-05-13 06:13:46 +0000
commitbd3cdcc0872c2ce75d82ecc5a426cb3ace641d0f (patch)
treeeb2005967068c3a8ec31dce8fb4dc415f37fe993 /gcc/cgraph.h
parent73647d75199a9e5c8a0e2e049d1f70b86d43c8f4 (diff)
downloadgcc-bd3cdcc0872c2ce75d82ecc5a426cb3ace641d0f.tar.gz
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
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index dbfc89f8f1d..1ccae09aa06 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);