diff options
author | Jan Hubicka <jh@suse.cz> | 2005-06-24 17:14:04 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2005-06-24 15:14:04 +0000 |
commit | ce91e74c187986865c3de8fbd871242183afa93d (patch) | |
tree | cb74c75feb0a3380d0f1a108528cdc35a05f7892 /gcc/cgraph.c | |
parent | 62765fb14a52c42422b31938deb5893ebe13e735 (diff) | |
download | gcc-ce91e74c187986865c3de8fbd871242183afa93d.zip gcc-ce91e74c187986865c3de8fbd871242183afa93d.tar.gz gcc-ce91e74c187986865c3de8fbd871242183afa93d.tar.bz2 |
tree-optimize.c (init_tree_optimization_passes): Fix flags of all_passes and all_ipa_passes.
* tree-optimize.c (init_tree_optimization_passes): Fix flags of
all_passes and all_ipa_passes.
* c-common.c: Include cgraph.h
(handle_externally_visible_attribute): New function.
(c_common_att): Add "externally_visible" attribute.
* cgraph.c (decide_is_variable_needed): Obey externally
visible flag.
(cgraph_varpool_finalize_decl): Avoid redundant checking.
* cgraph.h (struct cgraph_node): New flag externally_visible.
(decide_is_function_needed): Obey externally visible flag.
(cgraph_finalize_function): Avoid redundant checks.
(cgraph_function_and_variable_visibility): Bring symbols local
when asked for.
* common.opt (fwhole-program): New flag.
* doc/invoke.texi (-fwhole-program): Document.
From-SVN: r101295
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r-- | gcc/cgraph.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c index b9b1b14..af84ebf 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -807,7 +807,8 @@ bool decide_is_variable_needed (struct cgraph_varpool_node *node, tree decl) { /* If the user told us it is used, then it must be so. */ - if (lookup_attribute ("used", DECL_ATTRIBUTES (decl))) + if (node->externally_visible + || lookup_attribute ("used", DECL_ATTRIBUTES (decl))) return true; /* ??? If the assembler name is set by hand, it is possible to assemble @@ -863,7 +864,7 @@ cgraph_varpool_finalize_decl (tree decl) /* Since we reclaim unreachable nodes at the end of every language level unit, we need to be conservative about possible entry points there. */ - if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) + else if (TREE_PUBLIC (decl) && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl)) cgraph_varpool_mark_needed_node (node); if (cgraph_global_info_ready || !flag_unit_at_a_time) cgraph_varpool_assemble_pending_decls (); |