aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-10-13 13:25:57 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2019-10-13 11:25:57 +0000
commit7cc4770980e20f6f480152277d2a64c226fdee2a (patch)
tree356b9851888fc5f5ec9f179911e5c5f8c69ee49e /gcc
parentf8cf94cd21b4b29e53eb779d2da50dc317690cb9 (diff)
downloadgcc-7cc4770980e20f6f480152277d2a64c226fdee2a.zip
gcc-7cc4770980e20f6f480152277d2a64c226fdee2a.tar.gz
gcc-7cc4770980e20f6f480152277d2a64c226fdee2a.tar.bz2
lto-common.c (read_cgraph_and_symbols): Grow ggc memory use after summary streaming.
* lto-common.c (read_cgraph_and_symbols): Grow ggc memory use after summary streaming. From-SVN: r276936
Diffstat (limited to 'gcc')
-rw-r--r--gcc/lto/ChangeLog5
-rw-r--r--gcc/lto/lto-common.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 2ef4a87..bb4e57e 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,5 +1,10 @@
2019-10-12 Jan Hubicka <hubicka@ucw.cz>
+ * lto-common.c (read_cgraph_and_symbols): Grow ggc memory use after
+ summary streaming.
+
+2019-10-12 Jan Hubicka <hubicka@ucw.cz>
+
* lto.c (lto_wpa_write_files): Do not update bodies of clones.
2019-10-11 Jan Hubicka <hubicka@ucw.cz>
diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c
index e5c15f2..967f228 100644
--- a/gcc/lto/lto-common.c
+++ b/gcc/lto/lto-common.c
@@ -2781,7 +2781,6 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
/* At this stage we know that majority of GGC memory is reachable.
Growing the limits prevents unnecesary invocation of GGC. */
ggc_grow ();
- ggc_collect ();
/* Set the hooks so that all of the ipa passes can read in their data. */
lto_set_in_hooks (all_file_decl_data, get_section_data, free_section_data);
@@ -2852,7 +2851,11 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
if (tree_with_vars)
ggc_free (tree_with_vars);
tree_with_vars = NULL;
- ggc_collect ();
+ /* During WPA we want to prevent ggc collecting by default. Grow limits
+ until after the IPA summaries are streamed in. Basically all IPA memory
+ is explcitly managed by ggc_free and ggc collect is not useful.
+ Exception are the merged declarations. */
+ ggc_grow ();
timevar_pop (TV_IPA_LTO_DECL_MERGE);
/* Each pass will set the appropriate timer. */
@@ -2866,6 +2869,8 @@ read_cgraph_and_symbols (unsigned nfiles, const char **fnames)
else
ipa_read_summaries ();
+ ggc_grow ();
+
for (i = 0; all_file_decl_data[i]; i++)
{
gcc_assert (all_file_decl_data[i]->symtab_node_encoder);