aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto/lto.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-03-19 11:35:59 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-03-19 11:35:59 +0000
commite41106fc81513e4acdfb42baa5c82b0ebc92244a (patch)
tree98d450ba0f0a5224ee12be421db311ac7e1a25a3 /gcc/lto/lto.c
parent8c9cfbe630d539a250f3018976ae6f47202f8667 (diff)
downloadgcc-e41106fc81513e4acdfb42baa5c82b0ebc92244a.zip
gcc-e41106fc81513e4acdfb42baa5c82b0ebc92244a.tar.gz
gcc-e41106fc81513e4acdfb42baa5c82b0ebc92244a.tar.bz2
lto.c (lto_wpa_write_files): Move call to lto_promote_cross_file_statics ...
2014-03-19 Richard Biener <rguenther@suse.de> * lto.c (lto_wpa_write_files): Move call to lto_promote_cross_file_statics ... (do_whole_program_analysis): ... here, into the partitioning block. Do not ggc_collect after lto_wpa_write_files but for a last time before it. From-SVN: r208679
Diffstat (limited to 'gcc/lto/lto.c')
-rw-r--r--gcc/lto/lto.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 9ebcdce..df9f031 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2568,11 +2568,6 @@ lto_wpa_write_files (void)
FOR_EACH_VEC_ELT (ltrans_partitions, i, part)
lto_stats.num_output_symtab_nodes += lto_symtab_encoder_size (part->encoder);
- /* Find out statics that need to be promoted
- to globals with hidden visibility because they are accessed from multiple
- partitions. */
- lto_promote_cross_file_statics ();
-
timevar_pop (TV_WHOPR_WPA);
timevar_push (TV_WHOPR_WPA_IO);
@@ -3284,11 +3279,21 @@ do_whole_program_analysis (void)
node->aux = NULL;
lto_stats.num_cgraph_partitions += ltrans_partitions.length ();
+
+ /* Find out statics that need to be promoted
+ to globals with hidden visibility because they are accessed from multiple
+ partitions. */
+ lto_promote_cross_file_statics ();
timevar_pop (TV_WHOPR_PARTITIONING);
timevar_stop (TV_PHASE_OPT_GEN);
- timevar_start (TV_PHASE_STREAM_OUT);
+ /* Collect a last time - in lto_wpa_write_files we may end up forking
+ with the idea that this doesn't increase memory usage. So we
+ absoultely do not want to collect after that. */
+ ggc_collect ();
+
+ timevar_start (TV_PHASE_STREAM_OUT);
if (!quiet_flag)
{
fprintf (stderr, "\nStreaming out");
@@ -3297,10 +3302,8 @@ do_whole_program_analysis (void)
lto_wpa_write_files ();
if (!quiet_flag)
fprintf (stderr, "\n");
-
timevar_stop (TV_PHASE_STREAM_OUT);
- ggc_collect ();
if (post_ipa_mem_report)
{
fprintf (stderr, "Memory consumption after IPA\n");