On 1/15/20 11:49 AM, Martin Liška wrote:
Hi.

I know the root cause of the failure and will send a patch soon
to the mailing list.

Martin

There's an obvious patch that I'm going to install. Note that
order of function call evaluation in a function call is undefined.
It's a similar issue we had some time ago in IPA VRP streaming.

Patch can bootstrap on x86_64-linux-gnu and survives regression tests.

Thanks,
Martin
>From 674f2a3f4786fb61576c9152446937d617b1b4ce Mon Sep 17 00:00:00 2001
From: Martin Liska <mli...@suse.cz>
Date: Wed, 15 Jan 2020 11:49:48 +0100
Subject: [PATCH] Do not call streamer_read_hwi in a function call.

gcc/ChangeLog:

2020-01-15  Martin Liska  <mli...@suse.cz>

	* ipa-profile.c (ipa_profile_read_edge_summary): Do not allow
	2 calls of streamer_read_hwi in a function call.
---
 gcc/ipa-profile.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-profile.c b/gcc/ipa-profile.c
index fc231c916b7..03272f20987 100644
--- a/gcc/ipa-profile.c
+++ b/gcc/ipa-profile.c
@@ -451,8 +451,9 @@ ipa_profile_read_edge_summary (class lto_input_block *ib, cgraph_edge *edge)
 
   for (i = 0; i < len; i++)
   {
-    speculative_call_target item (streamer_read_hwi (ib),
-	streamer_read_hwi (ib));
+    unsigned int target_id = streamer_read_hwi (ib);
+    int target_probability = streamer_read_hwi (ib);
+    speculative_call_target item (target_id, target_probability);
     csum->speculative_call_targets.safe_push (item);
   }
 }
-- 
2.24.1

Reply via email to