diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-11 15:52:36 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-11 15:52:36 +0000 |
commit | 25429dc217ef11fd264f4e11244d4d409ee24484 (patch) | |
tree | 3863b58d5473996402091677849e3dda1ca988af /gcc/lto-cgraph.c | |
parent | bc200246fa501a868b88445a5b1eaa31fb2d9d76 (diff) | |
download | gcc-25429dc217ef11fd264f4e11244d4d409ee24484.tar.gz |
* lto-symtab.c (lto_symtab_free): New function.
* lto-streamer.h (lto_symtab_free): Declare.
* lto-cgraph.c (reachable_from_other_partition_p): Export; do not assume
that if function is needed it is reachable.
(lto_output_node): See if it the function is reachable or referenced.
(output_cgraph): Update call of lto_output_node.
* lto-streamer.h (reachable_from_other_partition_p): Declare.
* lto.c (lto_fixup_decls): Free no longer needed lto_global_var_decls
vector.
* lto.c (lto_1_to_1_map): Remove some no longer needed checks.
(lto_promote_cross_file_statics): Never promote DECL_EXTERNAL;
use reachable_from_other_partition_p and
referenced_from_other_partition_p test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159280 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r-- | gcc/lto-cgraph.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index a7c0947af37..df4d2446a12 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -312,12 +312,10 @@ referenced_from_other_partition_p (struct ipa_ref_list *list, cgraph_node_set se /* Return true when node is reachable from other partition. */ -static bool +bool reachable_from_other_partition_p (struct cgraph_node *node, cgraph_node_set set) { struct cgraph_edge *e; - if (node->needed) - return true; if (!node->analyzed) return false; if (node->global.inlined_to) @@ -339,6 +337,7 @@ reachable_from_other_partition_p (struct cgraph_node *node, cgraph_node_set set) static void lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, lto_cgraph_encoder_t encoder, cgraph_node_set set, + varpool_node_set vset, bitmap written_decls) { unsigned int tag; @@ -400,7 +399,9 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, bp_pack_value (bp, node->address_taken, 1); bp_pack_value (bp, node->abstract_and_needed, 1); bp_pack_value (bp, tag == LTO_cgraph_analyzed_node - && reachable_from_other_partition_p (node, set), 1); + && !DECL_EXTERNAL (node->decl) + && (reachable_from_other_partition_p (node, set) + || referenced_from_other_partition_p (&node->ref_list, set, vset)), 1); bp_pack_value (bp, node->lowered, 1); bp_pack_value (bp, in_other_partition, 1); bp_pack_value (bp, node->alias, 1); @@ -767,7 +768,7 @@ output_cgraph (cgraph_node_set set, varpool_node_set vset) for (i = 0; i < n_nodes; i++) { node = lto_cgraph_encoder_deref (encoder, i); - lto_output_node (ob, node, encoder, set, written_decls); + lto_output_node (ob, node, encoder, set, vset, written_decls); } lto_bitmap_free (written_decls); |