From: Jan Hubicka Date: Fri, 13 Jul 2018 19:09:13 +0000 (+0200) Subject: lto.c (do_stream_out): Add PART parameter; open dump file. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=814f3331877bd59654178543198e1801abee6acf;p=gcc.git lto.c (do_stream_out): Add PART parameter; open dump file. * lto.c (do_stream_out): Add PART parameter; open dump file. (stream_out): Add PART parameter; pass it to do_stream_out. (lto_wpa_write_files): Update call of stream_out. * lto-streamer-out.c (copy_function_or_variable): Dump info about copying section. From-SVN: r262645 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 70cf49636f1..14bfd9ea69d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-07-13 Jan Hubicka + + * lto-streamer-out.c (copy_function_or_variable): Dump info about + copying section. + 2018-07-13 Bill Schmidt Steve Munroe diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c index bdbe591f8a1..78b90e7f596 100644 --- a/gcc/lto-streamer-out.c +++ b/gcc/lto-streamer-out.c @@ -2293,6 +2293,8 @@ copy_function_or_variable (struct symtab_node *node) struct lto_in_decl_state *in_state; struct lto_out_decl_state *out_state = lto_get_out_decl_state (); + if (streamer_dump_file) + fprintf (streamer_dump_file, "Copying section for %s\n", name); lto_begin_section (section_name, false); free (section_name); diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index daaf92f489c..91e8647d42a 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2018-07-13 Jan Hubicka + + * lto.c (do_stream_out): Add PART parameter; open dump file. + (stream_out): Add PART parameter; pass it to do_stream_out. + (lto_wpa_write_files): Update call of stream_out. + 2018-07-04 Martin Liska PR middle-end/66240 diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 6f10dab27e5..d1add15efeb 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -2326,13 +2326,15 @@ static lto_file *current_lto_file; /* Actually stream out ENCODER into TEMP_FILENAME. */ static void -do_stream_out (char *temp_filename, lto_symtab_encoder_t encoder) +do_stream_out (char *temp_filename, lto_symtab_encoder_t encoder, int part) { lto_file *file = lto_obj_file_open (temp_filename, true); if (!file) fatal_error (input_location, "lto_obj_file_open() failed"); lto_set_current_out_file (file); + gcc_assert (!dump_file); + streamer_dump_file = dump_begin (TDI_lto_stream_out, NULL, part); ipa_write_optimization_summaries (encoder); free (CONST_CAST (char *, file->filename)); @@ -2340,6 +2342,11 @@ do_stream_out (char *temp_filename, lto_symtab_encoder_t encoder) lto_set_current_out_file (NULL); lto_obj_file_close (file); free (file); + if (streamer_dump_file) + { + dump_end (TDI_lto_stream_out, streamer_dump_file); + streamer_dump_file = NULL; + } } /* Wait for forked process and signal errors. */ @@ -2372,14 +2379,14 @@ wait_for_child () static void stream_out (char *temp_filename, lto_symtab_encoder_t encoder, - bool ARG_UNUSED (last)) + bool ARG_UNUSED (last), int part) { #ifdef HAVE_WORKING_FORK static int nruns; if (lto_parallelism <= 1) { - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); return; } @@ -2399,12 +2406,12 @@ stream_out (char *temp_filename, lto_symtab_encoder_t encoder, if (!cpid) { setproctitle ("lto1-wpa-streaming"); - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); exit (0); } /* Fork failed; lets do the job ourseleves. */ else if (cpid == -1) - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); else nruns++; } @@ -2412,13 +2419,13 @@ stream_out (char *temp_filename, lto_symtab_encoder_t encoder, else { int i; - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); for (i = 0; i < nruns; i++) wait_for_child (); } asm_nodes_output = true; #else - do_stream_out (temp_filename, encoder); + do_stream_out (temp_filename, encoder, part); #endif } @@ -2508,7 +2515,7 @@ lto_wpa_write_files (void) } gcc_checking_assert (lto_symtab_encoder_size (part->encoder) || !i); - stream_out (temp_filename, part->encoder, i == n_sets - 1); + stream_out (temp_filename, part->encoder, i == n_sets - 1, i); part->encoder = NULL;