aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-cgraph.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2014-06-11 07:51:23 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2014-06-11 05:51:23 +0000
commite257a17cb9cc4dc76a79680616420e75ba030b5f (patch)
tree1eaa587ddb6f0f91bbd446438e1bb46f9b1df815 /gcc/lto-cgraph.c
parent58170a6621f1677c692634d28c4f67a24da42b13 (diff)
downloadgcc-e257a17cb9cc4dc76a79680616420e75ba030b5f.zip
gcc-e257a17cb9cc4dc76a79680616420e75ba030b5f.tar.gz
gcc-e257a17cb9cc4dc76a79680616420e75ba030b5f.tar.bz2
varasm.c (set_implicit_section): New function.
* varasm.c (set_implicit_section): New function. (resolve_unique_section): Use it to set implicit section for aliases, too. (get_named_text_section): Use symtab_get_node (decl)->implicit_section (default_function_section): Likewise. (decl_binds_to_current_def_p): Constify argument. * varasm.h (decl_binds_to_current_def_p): Update prototype. * asan.c (asan_protect_global): Use symtab_get_node (decl)->implicit_section. * symtab.c (dump_symtab_base): Dump implicit sections. (verify_symtab_base): Verify sanity of sectoins and comdats. (symtab_resolve_alias): Alias share the section of its target. (set_section_1): New function. (symtab_node::set_section): Move here, recurse to aliases. (verify_symtab): Check for duplicated symtab lists. * tree-core.h (implicit_section_name_p): Remove. * tree-vect-data-refs.c: Include varasm.h. (vect_can_force_dr_alignment_p): Fix conditional on when decl bints to current definition; use symtab_get_node (decl)->implicit_section. * cgraph.c (cgraph_make_node_local_1): Fix section set. * cgraph.h (struct symtab_node): Add implicit_section. (set_section): Rename to ... (set_section_for_node): ... this one. (set_section): Declare. * tree.h (DECL_HAS_IMPLICIT_SECTION_NAME_P): Remove. * lto-cgraph.c (lto_output_node, lto_output_varpool_node, input_overwrite_node, input_varpool_node): Stream implicit_section. * ipa.c (symtab_remove_unreachable_nodes): Do not check symtab before removal; it will fail in LTO. * vtable-class-hierarchy.c: Use symtab_get_node (var_decl)->implicit_section. * optimize.c (cdtor_comdat_group): Fix handling of aliases. (maybe_clone_body): Move symbol across comdat groups. * method.c (use_thunk): Copy implicit section flag. * go/go-gcc.cc (Gcc_backend::global_variable_set_init): Use symtab_get_node(var_decl)->implicit_section. * lto.c (read_cgraph_and_symbols): Remove unreachable symbols. (do_whole_program_analysis): Use verify_symtab. From-SVN: r211434
Diffstat (limited to 'gcc/lto-cgraph.c')
-rw-r--r--gcc/lto-cgraph.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c
index a19197d..70e813d 100644
--- a/gcc/lto-cgraph.c
+++ b/gcc/lto-cgraph.c
@@ -501,10 +501,8 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
streamer_write_hwi_stream (ob->main_stream, ref);
}
- group = node->get_section ();
- if (group)
- section = TREE_STRING_POINTER (group);
- else
+ section = node->get_section ();
+ if (!section)
section = "";
lto_output_data_stream (ob->main_stream, section, strlen (section) + 1);
@@ -521,6 +519,7 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node,
bp_pack_value (&bp, node->forced_by_abi, 1);
bp_pack_value (&bp, node->unique_name, 1);
bp_pack_value (&bp, node->body_removed, 1);
+ bp_pack_value (&bp, node->implicit_section, 1);
bp_pack_value (&bp, node->address_taken, 1);
bp_pack_value (&bp, tag == LTO_symtab_analyzed_node
&& symtab_get_symbol_partitioning_class (node) == SYMBOL_PARTITION
@@ -585,6 +584,7 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
bp_pack_value (&bp, node->forced_by_abi, 1);
bp_pack_value (&bp, node->unique_name, 1);
bp_pack_value (&bp, node->body_removed, 1);
+ bp_pack_value (&bp, node->implicit_section, 1);
bp_pack_value (&bp, node->writeonly, 1);
bp_pack_value (&bp, node->definition, 1);
alias_p = node->alias && (!boundary_p || node->weakref);
@@ -631,10 +631,8 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node,
streamer_write_hwi_stream (ob->main_stream, ref);
}
- group = node->get_section ();
- if (group)
- section = TREE_STRING_POINTER (group);
- else
+ section = node->get_section ();
+ if (!section)
section = "";
lto_output_data_stream (ob->main_stream, section, strlen (section) + 1);
@@ -1054,6 +1052,7 @@ input_overwrite_node (struct lto_file_decl_data *file_data,
node->forced_by_abi = bp_unpack_value (bp, 1);
node->unique_name = bp_unpack_value (bp, 1);
node->body_removed = bp_unpack_value (bp, 1);
+ node->implicit_section = bp_unpack_value (bp, 1);
node->address_taken = bp_unpack_value (bp, 1);
node->used_from_other_partition = bp_unpack_value (bp, 1);
node->lowered = bp_unpack_value (bp, 1);
@@ -1194,7 +1193,7 @@ input_node (struct lto_file_decl_data *file_data,
else
node->same_comdat_group = (symtab_node *) (intptr_t) LCC_NOT_FOUND;
if (section)
- node->set_section (section);
+ node->set_section_for_node (section);
if (node->thunk.thunk_p)
{
@@ -1251,6 +1250,7 @@ input_varpool_node (struct lto_file_decl_data *file_data,
node->forced_by_abi = bp_unpack_value (&bp, 1);
node->unique_name = bp_unpack_value (&bp, 1);
node->body_removed = bp_unpack_value (&bp, 1);
+ node->implicit_section = bp_unpack_value (&bp, 1);
node->writeonly = bp_unpack_value (&bp, 1);
node->definition = bp_unpack_value (&bp, 1);
node->alias = bp_unpack_value (&bp, 1);
@@ -1277,7 +1277,7 @@ input_varpool_node (struct lto_file_decl_data *file_data,
node->same_comdat_group = (symtab_node *) (intptr_t) LCC_NOT_FOUND;
section = read_string_cst (ib);
if (section)
- node->set_section (section);
+ node->set_section_for_node (section);
node->resolution = streamer_read_enum (ib, ld_plugin_symbol_resolution,
LDPR_NUM_KNOWN);
gcc_assert (flag_ltrans