diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 18:15:17 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-11-16 18:15:17 +0000 |
commit | 7410370bd303fd440cb530bb2fe4fc4c2d944b5d (patch) | |
tree | b9cf407f17bdb390a410566498c603ef34073ef6 /gcc/ipa.c | |
parent | f369130eb68c3206c86c59ec5bba04d8f79f90df (diff) | |
download | gcc-7410370bd303fd440cb530bb2fe4fc4c2d944b5d.tar.gz |
* cgraph.h (+varpool_can_remove_if_no_refs): Move here from ...;
when !flag_toplevel_reorder do not remove unless variable is
COMDAT or ARTIFICIAL.
* ipa.c (varpool_can_remove_if_no_refs): ... here.
(cgraph_remove_unreachable_nodes): Only analyzed nodes needs to stay.
* cgraphunit.c (cgraph_analyze_functions): Dump varpool, too.
* varpool.c (decide_is_variable_needed): Do not handle visibility issues.
(varpool_finalize_decl): Likewise.
(varpool_remove_unreferenced_decls): Use varpool_mark_needed_node; update
outdated comment on DECL_RTL_SET_P check.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166812 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r-- | gcc/ipa.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c index 1dd85f80c36..3742f84e53b 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -188,16 +188,6 @@ process_references (struct ipa_ref_list *list, } } -/* Return true when function NODE can be removed from callgraph - if all direct calls are eliminated. */ - -static inline bool -varpool_can_remove_if_no_refs (struct varpool_node *node) -{ - return (!node->force_output && !node->used_from_other_partition - && (DECL_COMDAT (node->decl) || !node->externally_visible)); -} - /* Return true when function can be marked local. */ static bool @@ -269,7 +259,8 @@ cgraph_remove_unreachable_nodes (bool before_inlining_p, FILE *file) { vnode->next_needed = NULL; vnode->prev_needed = NULL; - if (!varpool_can_remove_if_no_refs (vnode)) + if (vnode->analyzed + && !varpool_can_remove_if_no_refs (vnode)) { vnode->needed = false; varpool_mark_needed_node (vnode); |