summaryrefslogtreecommitdiff
path: root/gcc/passes.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/passes.c')
-rw-r--r--gcc/passes.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/passes.c b/gcc/passes.c
index e2b9369824e..1b98e99eef9 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -1792,9 +1792,26 @@ void
ipa_write_optimization_summaries (cgraph_node_set set, varpool_node_set vset)
{
struct lto_out_decl_state *state = lto_new_out_decl_state ();
+ cgraph_node_set_iterator csi;
compute_ltrans_boundary (state, set, vset);
lto_push_out_decl_state (state);
+ for (csi = csi_start (set); !csi_end_p (csi); csi_next (&csi))
+ {
+ struct cgraph_node *node = csi_node (csi);
+ /* When streaming out references to statements as part of some IPA
+ pass summary, the statements need to have uids assigned.
+
+ For functions newly born at WPA stage we need to initialize
+ the uids here. */
+ if (node->analyzed
+ && gimple_has_body_p (node->decl))
+ {
+ push_cfun (DECL_STRUCT_FUNCTION (node->decl));
+ renumber_gimple_stmt_uids ();
+ pop_cfun ();
+ }
+ }
gcc_assert (flag_wpa);
ipa_write_optimization_summaries_1 (all_regular_ipa_passes, set, vset, state);