aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-10-30 11:38:52 +0100
committerMartin Liska <marxin@gcc.gnu.org>2019-10-30 10:38:52 +0000
commit3c56d8d8de26c7d7ac46733b7b3c01ae34e144f1 (patch)
treefa3f3e368cfb454737f1269277b2ea7d8b2c89e1 /gcc/lto-streamer-out.c
parent01509e2f045ab897000de7a2b242a059a99a89a3 (diff)
downloadgcc-3c56d8d8de26c7d7ac46733b7b3c01ae34e144f1.zip
gcc-3c56d8d8de26c7d7ac46733b7b3c01ae34e144f1.tar.gz
gcc-3c56d8d8de26c7d7ac46733b7b3c01ae34e144f1.tar.bz2
Use symtab_node::order in LTO sections with body.
2019-10-30 Martin Liska <mliska@suse.cz> PR lto/91393 PR lto/88220 * cgraph.c (cgraph_node::get_create): Overwrite node->order from a first_clone in order to get proper LTO section in LTO stream. (cgraph_node::get_untransformed_body): Use lto_get_section_data where symtab_node::order must be provided. * cgraphclones.c (cgraph_node::find_replacement): Update also symbol order. * ipa-fnsummary.c (ipa_fn_summary_read): Use new function lto_get_summary_section_data. * ipa-hsa.c (ipa_hsa_read_summary): Likewise. * ipa-icf.c (sem_item_optimizer::read_summary): Likewise. * ipa-prop.c (ipa_prop_read_jump_functions): Likewise. (ipcp_read_transformation_summaries): Likewise. * ipa-sra.c (ipa_sra_read_summary): Likewise. * lto-cgraph.c (input_node): Add also order_base. (input_varpool_node): Likewise. (input_cgraph_1): Assign the order_base. (input_cgraph_opt_summary): Use new lto_get_summary_section_data. * lto-opts.c (lto_write_options): Pass new argument. * lto-section-in.c (lto_get_section_data): Add new argumente order. (lto_get_summary_section_data): New. (lto_get_raw_section_data): Add order argument. (lto_create_simple_input_block): Likewise. * lto-section-out.c (lto_destroy_simple_output_block): Likewise. * lto-streamer-in.c (lto_input_toplevel_asms): Use lto_get_summary_section_data. (lto_input_mode_table): Likewise. * lto-streamer-out.c (produce_asm): Pass symtab_node::order. (lto_output_toplevel_asms): Pass new argument. (copy_function_or_variable): Likewise. (produce_lto_section):Likewise. (produce_symtab): Likewise. (lto_write_mode_table): Likewise. (produce_asm_for_decls): Likewise. * lto-streamer.c (lto_get_section_name): Concat symbol name and symbol order. * lto-streamer.h (lto_get_section_data): Add order argument. (lto_get_summary_section_data): New. (lto_get_raw_section_data): Add order argument. (lto_get_section_name): Likewise. * varpool.c (varpool_node::get_constructor): Pass order argument. 2019-10-30 Martin Liska <mliska@suse.cz> PR lto/91393 PR lto/88220 * lto-common.c (lto_file_finalize): Use lto_get_summary_section_data. (get_section_data): Add order argument. 2019-10-30 Martin Liska <mliska@suse.cz> PR lto/91393 PR lto/88220 * gcc.dg/lto/pr91393_0.c: New test. From-SVN: r277607
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 3ecaddd..cf45cc3 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -1972,10 +1972,12 @@ produce_asm (struct output_block *ob, tree fn)
if (section_type == LTO_section_function_body)
{
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fn));
- section_name = lto_get_section_name (section_type, name, NULL);
+ section_name = lto_get_section_name (section_type, name,
+ symtab_node::get (fn)->order,
+ NULL);
}
else
- section_name = lto_get_section_name (section_type, NULL, NULL);
+ section_name = lto_get_section_name (section_type, NULL, 0, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);
@@ -2278,7 +2280,7 @@ lto_output_toplevel_asms (void)
streamer_write_string_cst (ob, ob->main_stream, NULL_TREE);
- section_name = lto_get_section_name (LTO_section_asm, NULL, NULL);
+ section_name = lto_get_section_name (LTO_section_asm, NULL, 0, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);
@@ -2311,7 +2313,7 @@ copy_function_or_variable (struct symtab_node *node)
size_t len;
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function));
char *section_name =
- lto_get_section_name (LTO_section_function_body, name, NULL);
+ lto_get_section_name (LTO_section_function_body, name, node->order, NULL);
size_t i, j;
struct lto_in_decl_state *in_state;
struct lto_out_decl_state *out_state = lto_get_out_decl_state ();
@@ -2325,7 +2327,8 @@ copy_function_or_variable (struct symtab_node *node)
name = lto_get_decl_name_mapping (file_data, name);
data = lto_get_raw_section_data (file_data, LTO_section_function_body,
- name, &len);
+ name, node->order - file_data->order_base,
+ &len);
gcc_assert (data);
/* Do a bit copy of the function body. */
@@ -2410,7 +2413,7 @@ produce_lto_section ()
/* Stream LTO meta section. */
output_block *ob = create_output_block (LTO_section_lto);
- char * section_name = lto_get_section_name (LTO_section_lto, NULL, NULL);
+ char * section_name = lto_get_section_name (LTO_section_lto, NULL, 0, NULL);
lto_begin_section (section_name, false);
free (section_name);
@@ -2784,7 +2787,7 @@ static void
produce_symtab (struct output_block *ob)
{
struct streamer_tree_cache_d *cache = ob->writer_cache;
- char *section_name = lto_get_section_name (LTO_section_symtab, NULL, NULL);
+ char *section_name = lto_get_section_name (LTO_section_symtab, NULL, 0, NULL);
lto_symtab_encoder_t encoder = ob->decl_state->symtab_node_encoder;
lto_symtab_encoder_iterator lsei;
@@ -2884,7 +2887,7 @@ lto_write_mode_table (void)
streamer_write_bitpack (&bp);
char *section_name
- = lto_get_section_name (LTO_section_mode_table, NULL, NULL);
+ = lto_get_section_name (LTO_section_mode_table, NULL, 0, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);
@@ -2928,7 +2931,7 @@ produce_asm_for_decls (void)
memset (&header, 0, sizeof (struct lto_decl_header));
- section_name = lto_get_section_name (LTO_section_decls, NULL, NULL);
+ section_name = lto_get_section_name (LTO_section_decls, NULL, 0, NULL);
lto_begin_section (section_name, !flag_wpa);
free (section_name);