Commit 33c3b6be by Jan Hubicka Committed by Jan Hubicka

re PR ipa/64378 (ICE: in inline_call, at ipa-inline-transform.c:347 with -O3 -fno-ipa-cp)


	PR ipa/64378
	* ipa-prop.c (try_make_edge_direct_virtual_call): Clear speculative
	flag correctly.
	* ipa-cp.c (ipa_get_indirect_edge_target_1): Handle speculation.
	* g++.dg/torture/pr64378.C: New testcase.

From-SVN: r219822
parent 257024e3
2015-01-18 Jan Hubicka <hubicka@ucw.cz>
PR ipa/64378
* ipa-prop.c (try_make_edge_direct_virtual_call): Clear speculative
flag correctly.
* ipa-cp.c (ipa_get_indirect_edge_target_1): Handle speculation.
2015-01-18 Sandra Loosemore <sandra@codesourcery.com> 2015-01-18 Sandra Loosemore <sandra@codesourcery.com>
* doc/invoke.texi ([-funroll-loops], [-funroll-all-loops]): * doc/invoke.texi ([-funroll-loops], [-funroll-all-loops]):
......
...@@ -1975,8 +1975,13 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie, ...@@ -1975,8 +1975,13 @@ ipa_get_indirect_edge_target_1 (struct cgraph_edge *ie,
} }
} }
else if (t) else if (t)
context = ipa_polymorphic_call_context (t, ie->indirect_info->otr_type, {
anc_offset); context = ipa_polymorphic_call_context (t, ie->indirect_info->otr_type,
anc_offset);
if (ie->indirect_info->vptr_changed)
context.possible_dynamic_type_change (ie->in_polymorphic_cdtor,
ie->indirect_info->otr_type);
}
else else
return NULL_TREE; return NULL_TREE;
......
...@@ -2985,7 +2985,7 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie, ...@@ -2985,7 +2985,7 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie,
|| !possible_polymorphic_call_target_p || !possible_polymorphic_call_target_p
(ie, cgraph_node::get (t))) (ie, cgraph_node::get (t)))
{ {
/* Do not speculate builtin_unreachable, it is stpid! */ /* Do not speculate builtin_unreachable, it is stupid! */
if (!ie->indirect_info->vptr_changed) if (!ie->indirect_info->vptr_changed)
target = ipa_impossible_devirt_target (ie, target); target = ipa_impossible_devirt_target (ie, target);
} }
...@@ -3013,6 +3013,7 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie, ...@@ -3013,6 +3013,7 @@ try_make_edge_direct_virtual_call (struct cgraph_edge *ie,
ctx, &final); ctx, &final);
if (final && targets.length () <= 1) if (final && targets.length () <= 1)
{ {
speculative = false;
if (targets.length () == 1) if (targets.length () == 1)
target = targets[0]->decl; target = targets[0]->decl;
else else
......
2015-01-18 Jan Hubicka <hubicka@ucw.cz>
PR ipa/64378
* g++.dg/torture/pr64378.C: New testcase.
2015-01-18 Paul Thomas <pault@gcc.gnu.org> 2015-01-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/57959 PR fortran/57959
......
// { dg-do compile }
// { dg-options "-fno-ipa-cp" }
struct data {
data(int) {}
};
struct top {
virtual int topf() {}
};
struct child1: top {
void childf()
{
data d(topf());
}
};
void test(top *t)
{
child1 *c = static_cast<child1 *>(t);
c->childf();
child1 d;
test(&d);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment