diff options
author | Martin Liska <mliska@suse.cz> | 2019-10-30 11:38:52 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2019-10-30 10:38:52 +0000 |
commit | 3c56d8d8de26c7d7ac46733b7b3c01ae34e144f1 (patch) | |
tree | fa3f3e368cfb454737f1269277b2ea7d8b2c89e1 /gcc/lto-cgraph.c | |
parent | 01509e2f045ab897000de7a2b242a059a99a89a3 (diff) | |
download | gcc-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-cgraph.c')
-rw-r--r-- | gcc/lto-cgraph.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 5b11150..a4a70e7 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -49,9 +49,6 @@ static void input_cgraph_opt_summary (vec<symtab_node *> nodes); /* Number of LDPR values known to GCC. */ #define LDPR_NUM_KNOWN (LDPR_PREVAILING_DEF_IRONLY_EXP + 1) -/* All node orders are ofsetted by ORDER_BASE. */ -static int order_base; - /* Cgraph streaming is organized as set of record whose type is indicated by a tag. */ enum LTO_symtab_tags @@ -1218,7 +1215,7 @@ input_node (struct lto_file_decl_data *file_data, int i, count; tree group; const char *section; - order = streamer_read_hwi (ib) + order_base; + order = streamer_read_hwi (ib) + file_data->order_base; clone_ref = streamer_read_hwi (ib); decl_index = streamer_read_uhwi (ib); @@ -1337,7 +1334,7 @@ input_varpool_node (struct lto_file_decl_data *file_data, tree group; const char *section; - order = streamer_read_hwi (ib) + order_base; + order = streamer_read_hwi (ib) + file_data->order_base; decl_index = streamer_read_uhwi (ib); var_decl = lto_file_decl_data_get_var_decl (file_data, decl_index); @@ -1504,7 +1501,7 @@ input_cgraph_1 (struct lto_file_decl_data *file_data, unsigned i; tag = streamer_read_enum (ib, LTO_symtab_tags, LTO_symtab_last_tag); - order_base = symtab->order; + file_data->order_base = symtab->order; while (tag) { if (tag == LTO_symtab_edge) @@ -1529,7 +1526,7 @@ input_cgraph_1 (struct lto_file_decl_data *file_data, tag = streamer_read_enum (ib, LTO_symtab_tags, LTO_symtab_last_tag); } - lto_input_toplevel_asms (file_data, order_base); + lto_input_toplevel_asms (file_data, file_data->order_base); /* AUX pointers should be all non-zero for function nodes read from the stream. */ if (flag_checking) @@ -2037,10 +2034,9 @@ input_cgraph_opt_summary (vec<symtab_node *> nodes) while ((file_data = file_data_vec[j++])) { size_t len; - const char *data = - lto_get_section_data (file_data, LTO_section_cgraph_opt_sum, NULL, - &len); - + const char *data + = lto_get_summary_section_data (file_data, LTO_section_cgraph_opt_sum, + &len); if (data) input_cgraph_opt_section (file_data, data, len, nodes); } |