summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-19 11:35:59 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-19 11:35:59 +0000
commit4e6f2fb9dc03deb9ef0330388a09e44ea20b0948 (patch)
tree98d450ba0f0a5224ee12be421db311ac7e1a25a3
parent1df9b23b3b3db8974b555cba9ca291887ec46bcd (diff)
downloadgcc-4e6f2fb9dc03deb9ef0330388a09e44ea20b0948.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208679 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/lto/ChangeLog8
-rw-r--r--gcc/lto/lto.c19
2 files changed, 19 insertions, 8 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index b8c20673704..101fbfb7b25 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,11 @@
+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.
+
2014-03-19 Jakub Jelinek <jakub@redhat.com>
PR lto/60571
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index 9ebcdce3a45..df9f031518a 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");