public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix count comparison in ipa-cp
@ 2022-11-21 21:26 Eugene Rozenfeld
  2022-11-22 20:02 ` Jeff Law
  0 siblings, 1 reply; 3+ messages in thread
From: Eugene Rozenfeld @ 2022-11-21 21:26 UTC (permalink / raw)
  To: gcc-patches

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-07  1:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 21:26 [PATCH] Fix count comparison in ipa-cp Eugene Rozenfeld
2022-11-22 20:02 ` Jeff Law
2022-12-07  1:25   ` [EXTERNAL] " Eugene Rozenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).