summaryrefslogtreecommitdiff
path: root/gcc/cgraph.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/cgraph.c
parent01509e2f045ab897000de7a2b242a059a99a89a3 (diff)
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/cgraph.c')
-rw-r--r--gcc/cgraph.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 33fba5a8f1c..9eea0218c4f 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -547,6 +547,7 @@ cgraph_node::get_create (tree decl)
{
first_clone->clone_of = node;
node->clones = first_clone;
+ node->order = first_clone->order;
symtab->symtab_prevail_in_asm_name_hash (node);
node->decl->decl_with_vis.symtab_node = node;
if (dump_file)
@@ -3546,12 +3547,17 @@ cgraph_node::get_untransformed_body (void)
struct lto_in_decl_state *decl_state
= lto_get_function_in_decl_state (file_data, decl);
+ cgraph_node *origin = this;
+ while (origin->clone_of)
+ origin = origin->clone_of;
+
+ int stream_order = origin->order - file_data->order_base;
data = lto_get_section_data (file_data, LTO_section_function_body,
- name, &len, decl_state->compressed);
+ name, stream_order, &len,
+ decl_state->compressed);
if (!data)
- fatal_error (input_location, "%s: section %s is missing",
- file_data->file_name,
- name);
+ fatal_error (input_location, "%s: section %s.%d is missing",
+ file_data->file_name, name, stream_order);
gcc_assert (DECL_STRUCT_FUNCTION (decl) == NULL);