summaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-17 08:58:37 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-02-17 08:58:37 +0000
commitddd4cdce82548f7eddc30b0caa4cb3a5d0a0116a (patch)
tree9264313f245864186f9fda4ff8b7a195578c0634 /gcc/lto-cgraph.c
parent04103c39b5bd000fd70c90f04b86ffc46feb37fd (diff)
downloadgcc-ddd4cdce82548f7eddc30b0caa4cb3a5d0a0116a.tar.gz
* symtab.c (symtab_node::verify_base): Verify body_removed->!definiton
* lto-cgraph.c (lto_output_varpool_node): Do not keep definition of variables in boundary that have no inlitalizer encoded and are not aliases. * varasm.c (default_binds_local_p_2): External definitions do not count as definitions here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220749 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index c0fa47d2c25..6add7fdf3d8 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -608,12 +608,18 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
lto_symtab_encoder_t encoder)
{
bool boundary_p = !lto_symtab_encoder_in_partition_p (encoder, node);
+ bool encode_initializer_p
+ = (node->definition
+ && lto_symtab_encoder_encode_initializer_p (encoder, node));
struct bitpack_d bp;
int ref;
const char *comdat;
const char *section;
tree group;
+ gcc_assert (!encode_initializer_p || node->definition);
+ gcc_assert (boundary_p || encode_initializer_p);
+
streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag,
LTO_symtab_variable);
streamer_write_hwi_stream (ob->main_stream, node->order);
@@ -624,11 +630,14 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
bp_pack_value (&bp, node->force_output, 1);
bp_pack_value (&bp, node->forced_by_abi, 1);
bp_pack_value (&bp, node->unique_name, 1);
- bp_pack_value (&bp, node->body_removed
- || !lto_symtab_encoder_encode_initializer_p (encoder, node), 1);
+ bp_pack_value (&bp,
+ node->body_removed
+ || (!encode_initializer_p && !node->alias && node->definition),
+ 1);
bp_pack_value (&bp, node->implicit_section, 1);
bp_pack_value (&bp, node->writeonly, 1);
- bp_pack_value (&bp, node->definition, 1);
+ bp_pack_value (&bp, node->definition && (encode_initializer_p || node->alias),
+ 1);
bp_pack_value (&bp, node->alias, 1);
bp_pack_value (&bp, node->weakref, 1);
bp_pack_value (&bp, node->analyzed && !boundary_p, 1);