http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55823
--- Comment #7 from Jan Hubicka <hubicka at gcc dot gnu.org> 2013-01-03
16:26:16 UTC ---
The following patch to devirtualize before updating jump functions solves the
testcase but I am not at all sure it is correct.
Index: ipa-prop.c
===================================================================
--- ipa-prop.c (revision 194770)
+++ ipa-prop.c (working copy)
@@ -2264,8 +2264,19 @@ update_indirect_edges_after_inlining (st
param_index = ici->param_index;
jfunc = ipa_get_ith_jump_func (top, param_index);
- if (jfunc->type == IPA_JF_PASS_THROUGH
- && ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
+
+ if (!flag_indirect_inlining)
+ ;
+ else if (ici->polymorphic)
+ new_direct_edge = try_make_edge_direct_virtual_call (ie, jfunc,
+ new_root_info);
+ else
+ new_direct_edge = try_make_edge_direct_simple_call (ie, jfunc,
+ new_root_info);
+ if (new_direct_edge)
+ ;
+ else if (jfunc->type == IPA_JF_PASS_THROUGH
+ && ipa_get_jf_pass_through_operation (jfunc) == NOP_EXPR)
{
if (ici->agg_contents
&& !ipa_get_jf_pass_through_agg_preserved (jfunc))
@@ -2291,13 +2302,6 @@ update_indirect_edges_after_inlining (st
if (!flag_indirect_inlining)
continue;
- if (ici->polymorphic)
- new_direct_edge = try_make_edge_direct_virtual_call (ie, jfunc,
- new_root_info);
- else
- new_direct_edge = try_make_edge_direct_simple_call (ie, jfunc,
- new_root_info);
-
if (new_direct_edge)
{
new_direct_edge->indirect_inlining_edge = 1;