summaryrefslogtreecommitdiff
path: root/gcc/lto/lto.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-10-11 10:59:16 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2019-10-11 08:59:16 +0000
commit1fcf52a6a2208a57e4542e1b830a7ac5cfa216a2 (patch)
treeef9cac22b1e7b08c43bf2ff06a8714ed61dbcc77 /gcc/lto/lto.c
parent05626b02e8d02720771d361677b1d6cc38df9ddc (diff)
Do not allocate ggc during streaming.
* gimple-streamer-out.c (output_gimple_stmt): Add explicit function parameter. * lto-streamer-out.c: Include tree-dfa.h. (output_cfg): Do not use cfun. (lto_prepare_function_for_streaming): New. (output_function): Do not push cfun; do not initialize loop optimizer. * lto-streamer.h (lto_prepare_function_for_streaming): Declare. * passes.c (ipa_write_summaries): Use it. (ipa_write_optimization_summaries): Do not modify bodies. * tree-dfa.c (renumber_gimple_stmt_uids): Add function parameter. * tree.dfa.h (renumber_gimple_stmt_uids): Update prototype. * tree-ssa-dse.c (pass_dse::execute): Update use of renumber_gimple_stmt_uids. * tree-ssa-math-opts.c (pass_optimize_widening_mul::execute): Likewise. * lto.c (lto_wpa_write_files): Prepare all bodies for streaming. From-SVN: r276870
Diffstat (limited to 'gcc/lto/lto.c')
-rw-r--r--gcc/lto/lto.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index af3590cdad8..f7452c232fe 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -304,6 +304,13 @@ lto_wpa_write_files (void)
timevar_push (TV_WHOPR_WPA_IO);
+ cgraph_node *node;
+ /* Do body modifications needed for streaming before we fork out
+ worker processes. */
+ FOR_EACH_FUNCTION_WITH_GIMPLE_BODY (node)
+ if (gimple_has_body_p (node->decl))
+ lto_prepare_function_for_streaming (node);
+
/* Generate a prefix for the LTRANS unit files. */
blen = strlen (ltrans_output_list);
temp_filename = (char *) xmalloc (blen + sizeof ("2147483648.o"));