From: Jan Hubicka Date: Thu, 24 Apr 2025 16:35:54 +0000 (+0200) Subject: Fix ICE building deepsjeng with -fprofile-use X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cfb04e0de6aa438df9d8b83a3d8c7f93789b5c9f;p=thirdparty%2Fgcc.git Fix ICE building deepsjeng with -fprofile-use The problem here is division by zero, since adjusted 0 > precise 0. Fixed by using right test. gcc/ChangeLog: PR ipa/119924 * ipa-cp.cc (update_counts_for_self_gen_clones): Use nonzero_p. (update_profiling_info): Likewise. (update_specialized_profile): Likewise. --- diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index abde64b6f29..b4b96997d75 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -4639,7 +4639,7 @@ update_counts_for_self_gen_clones (cgraph_node *orig_node, const vec &self_gen_clones) { profile_count redist_sum = orig_node->count.ipa (); - if (!(redist_sum > profile_count::zero ())) + if (!redist_sum.nonzero_p ()) return; if (dump_file) @@ -4710,7 +4710,7 @@ update_counts_for_self_gen_clones (cgraph_node *orig_node, it. */ for (cgraph_node *n : self_gen_clones) { - if (!(n->count.ipa () > profile_count::zero ())) + if (!n->count.ipa ().nonzero_p ()) continue; desc_incoming_count_struct desc; @@ -4756,7 +4756,7 @@ update_profiling_info (struct cgraph_node *orig_node, profile_count new_sum; profile_count remainder, orig_node_count = orig_node->count.ipa (); - if (!(orig_node_count > profile_count::zero ())) + if (!orig_node_count.nonzero_p ()) return; if (dump_file) @@ -4920,7 +4920,7 @@ update_specialized_profile (struct cgraph_node *new_node, orig_node_count.dump (dump_file); fprintf (dump_file, "\n"); } - if (!(orig_node_count > profile_count::zero ())) + if (!orig_node_count.nonzero_p ()) return; new_node_count = new_node->count;