summaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-07 17:36:54 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-07 17:36:54 +0000
commite0dec29d6fa999d00c10078a676e253ea9a944cc (patch)
tree88a2ecfa7b9a4506583492a38ea5179fc643bd39 /gcc/lto-cgraph.c
parent796bb135db3d9f2e75722bccca526c96f234d56b (diff)
downloadgcc-e0dec29d6fa999d00c10078a676e253ea9a944cc.tar.gz
PR ipa/61886
* symtab.c (ultimate_transparent_alias_target): New inline function. (symbol_table::assembler_names_equal_p): New method; break out from ... (symbol_table::decl_assembler_name_equal): ... here. (symbol_table::change_decl_assembler_name): Also update names and translation links of transparent aliases. (symtab_node::dump_base): Dump transparent_alias. (symtab_node::verify_base): Implement basic transparent alias verification. (symtab_node::make_decl_local): Support localization of weakrefs; recurse to transparent aliases; set TREE_STATIC. (symtab_node::ultimate_alias_target_1): Handle visibility of transparent aliases. (symtab_node::resolve_alias): New parmaeter transparent; handle transparent aliases; recurse to aliases of aliases to fix comdat groups. (symtab_node::get_partitioning_class): Handle transparent aliases. * ipa-visibility.c (cgraph_externally_visible_p, varpool_node::externally_visible_p): Visibility of transparent alias depends on its target. (function_and_variable_visibility): Do not tweak visibility of transparent laiases. (function_and_variable_visibility): Likewise. * ipa.c (symbol_table::remove_unreachable_nodes): Clear transparent_alias flag. * alias.c (cgraph_node::create_alias, cgraph_node::get_availability): Support transparent aliases. * cgraph.h (symtab_node): Update prototype of resolve_alias; add transparent_alias flag. (symbol_table: Add assembler_names_equal_p. (symtab_node::real_symbol_p): Skip transparent aliases. * cgraphunit.c (cgraph_node::reset): Reset transparent_alias flag. (handle_alias_pairs): Set transparent_alias for weakref. (cgraph_node::assemble_thunks_and_aliases): Do not asemble transparent aliases. * lto-cgraph.c (lto_output_node): When outputting same_comdat_group skip symbols not put into boundary; stream transparent_alias. (lto_output_varpool_node): Likewise. (input_overwrite_node, input_varpool_node): Stream transparent alias. * varpool.c (ctor_for_folding, varpool_node::get_availability, varpool_node::assemble_aliases, symbol_table::remove_unreferenced_decls): Handle transparent aliase. (varpool_node::create_alias): Set transparent_alias. * lto-partition.c (add_symbol_to_partition_1, contained_in_symbol, rename_statics, rename_statics): Handle transparent aliases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231373 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index 67a9024ab28..e1c259593d9 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -485,11 +485,12 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
if (group)
{
- if (node->same_comdat_group && !boundary_p)
+ if (node->same_comdat_group)
{
- ref = lto_symtab_encoder_lookup (encoder,
- node->same_comdat_group);
- gcc_assert (ref != LCC_NOT_FOUND);
+ ref = LCC_NOT_FOUND;
+ for (struct symtab_node *n = node->same_comdat_group;
+ ref == LCC_NOT_FOUND && n != node; n = n->same_comdat_group)
+ ref = lto_symtab_encoder_lookup (encoder, n);
}
else
ref = LCC_NOT_FOUND;
@@ -523,6 +524,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
bp_pack_value (&bp, node->lowered, 1);
bp_pack_value (&bp, in_other_partition, 1);
bp_pack_value (&bp, node->alias, 1);
+ bp_pack_value (&bp, node->transparent_alias, 1);
bp_pack_value (&bp, node->weakref, 1);
bp_pack_value (&bp, node->frequency, 2);
bp_pack_value (&bp, node->only_called_at_startup, 1);
@@ -599,8 +601,9 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
bp_pack_value (&bp, node->definition && (encode_initializer_p || node->alias),
1);
bp_pack_value (&bp, node->alias, 1);
+ bp_pack_value (&bp, node->transparent_alias, 1);
bp_pack_value (&bp, node->weakref, 1);
- bp_pack_value (&bp, node->analyzed && !boundary_p, 1);
+ bp_pack_value (&bp, node->analyzed && (!boundary_p || node->alias), 1);
gcc_assert (node->definition || !node->analyzed);
/* Constant pool initializers can be de-unified into individual ltrans units.
FIXME: Alternatively at -Os we may want to avoid generating for them the local
@@ -632,11 +635,12 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
if (group)
{
- if (node->same_comdat_group && !boundary_p)
+ if (node->same_comdat_group)
{
- ref = lto_symtab_encoder_lookup (encoder,
- node->same_comdat_group);
- gcc_assert (ref != LCC_NOT_FOUND);
+ ref = LCC_NOT_FOUND;
+ for (struct symtab_node *n = node->same_comdat_group;
+ ref == LCC_NOT_FOUND && n != node; n = n->same_comdat_group)
+ ref = lto_symtab_encoder_lookup (encoder, n);
}
else
ref = LCC_NOT_FOUND;
@@ -1170,6 +1174,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
TREE_STATIC (node->decl) = 0;
}
node->alias = bp_unpack_value (bp, 1);
+ node->transparent_alias = bp_unpack_value (bp, 1);
node->weakref = bp_unpack_value (bp, 1);
node->frequency = (enum node_frequency)bp_unpack_value (bp, 2);
node->only_called_at_startup = bp_unpack_value (bp, 1);
@@ -1369,6 +1374,7 @@ input_varpool_node (struct lto_file_decl_data *file_data,
node->writeonly = bp_unpack_value (&bp, 1);
node->definition = bp_unpack_value (&bp, 1);
node->alias = bp_unpack_value (&bp, 1);
+ node->transparent_alias = bp_unpack_value (&bp, 1);
node->weakref = bp_unpack_value (&bp, 1);
node->analyzed = bp_unpack_value (&bp, 1);
node->used_from_other_partition = bp_unpack_value (&bp, 1);