The existing comparison was incorrect for non-PRECISE counts (e.g., AFDO): we could end up with a 0 base_count, which could lead to asserts, e.g., in good_cloning_opportunity_p.
gcc/ChangeLog: * ipa-cp.cc (ipcp_propagate_stage): Fix profile count comparison. --- gcc/ipa-cp.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index d2bcd5e5e69..9df8b456759 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -4225,7 +4225,7 @@ ipcp_propagate_stage (class ipa_topo_info *topo) for (cgraph_edge *cs = node->callees; cs; cs = cs->next_callee) { profile_count count = cs->count.ipa (); - if (!(count > profile_count::zero ())) + if (!count.nonzero_p ()) continue; enum availability avail; -- 2.25.1