diff options
author | Jan Hubicka <jh@suse.cz> | 2010-11-16 19:15:17 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-11-16 18:15:17 +0000 |
commit | df7705b18e1ca275f0ded892bd5fb6bd542eb988 (patch) | |
tree | b9cf407f17bdb390a410566498c603ef34073ef6 /gcc/ipa.c | |
parent | 3e794bfe4393d5398c21658837c7437f1a1cbc5c (diff) | |
download | gcc-df7705b18e1ca275f0ded892bd5fb6bd542eb988.zip gcc-df7705b18e1ca275f0ded892bd5fb6bd542eb988.tar.gz gcc-df7705b18e1ca275f0ded892bd5fb6bd542eb988.tar.bz2 |
cgraph.h (+varpool_can_remove_if_no_refs): Move here from ......
* 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.
From-SVN: r166812
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r-- | gcc/ipa.c | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -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); |