[Bug ipa/63470] [5 Regression] internal compiler error: in estimate_edge_growth, at ipa-inline.h:308
hubicka at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 12 07:57:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63470
--- Comment #12 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
The other bug is double ajdusting of call_stmt_size when the call is turned
direct. Fixed thus:
Index: ipa-prop.c
===================================================================
--- ipa-prop.c (revision 219430)
+++ ipa-prop.c (working copy)
@@ -2736,6 +2736,7 @@
"converting indirect call in %s to direct call to %s\n",
ie->caller->name (), callee->name ());
}
+ struct cgraph_edge *orig = ie;
if (!speculative)
ie = ie->make_direct (callee);
else
@@ -2750,11 +2751,16 @@
ie = ie->make_speculative
(callee, ie->count * 8 / 10, ie->frequency * 8 / 10);
}
- es = inline_edge_summary (ie);
- es->call_stmt_size -= (eni_size_weights.indirect_call_cost
- - eni_size_weights.call_cost);
- es->call_stmt_time -= (eni_time_weights.indirect_call_cost
- - eni_time_weights.call_cost);
+ /* If we resolved speuclative edge the cost is already up to date
+ for direct call (adjusted by inline_edge_duplication_hook). */
+ if (ie == orig)
+ {
+ es = inline_edge_summary (ie);
+ es->call_stmt_size -= (eni_size_weights.indirect_call_cost
+ - eni_size_weights.call_cost);
+ es->call_stmt_time -= (eni_time_weights.indirect_call_cost
+ - eni_time_weights.call_cost);
+ }
return ie;
}
Index: ipa-inline-analysis.c
===================================================================
--- ipa-inline-analysis.c (revision 219430)
+++ ipa-inline-analysis.c (working copy)
@@ -1312,6 +1312,14 @@
info->predicate = NULL;
edge_set_predicate (dst, srcinfo->predicate);
info->param = srcinfo->param.copy ();
+ if (!dst->indirect_unknown_callee && src->indirect_unknown_callee)
+ {
+ gcc_checking_assert (src->caller == dst->caller);
+ info->call_stmt_size -= (eni_size_weights.indirect_call_cost
+ - eni_size_weights.call_cost);
+ info->call_stmt_time -= (eni_time_weights.indirect_call_cost
+ - eni_time_weights.call_cost);
+ }
}
More information about the Gcc-bugs
mailing list