From 872ceb28a1be6a4ddd95d733083f4823ff7548e1 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 3 Apr 2015 20:19:53 +0200 Subject: re PR ipa/65655 (ICE in speculative_call_info, at cgraph.c:1151) PR ipa/65655 * ipa-inline-analysis.c (edge_set_predicate): Do not redirect speculative indirect edges to avoid ordering issue. * g++.dg/torture/pr65655.C: New testcase. From-SVN: r221860 --- gcc/ipa-inline-analysis.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/ipa-inline-analysis.c') diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 2f4eb9f..5d99887 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -793,7 +793,11 @@ edge_set_predicate (struct cgraph_edge *e, struct predicate *predicate) { /* If the edge is determined to be never executed, redirect it to BUILTIN_UNREACHABLE to save inliner from inlining into it. */ - if (predicate && false_predicate_p (predicate)) + if (predicate && false_predicate_p (predicate) + /* When handling speculative edges, we need to do the redirection + just once. Do it always on the direct edge, so we do not + attempt to resolve speculation while duplicating the edge. */ + && (!e->speculative || e->callee)) e = redirect_to_unreachable (e); struct inline_edge_summary *es = inline_edge_summary (e); -- cgit v1.1