diff mbox series

Fix profile_count comparsions with gcov_type

Message ID 20191201151349.h3a5m7ec7eowbnvy@kam.mff.cuni.cz
State New
Headers show
Series Fix profile_count comparsions with gcov_type | expand

Commit Message

Jan Hubicka Dec. 1, 2019, 3:13 p.m. UTC
Hi,
this patch fixes one extra (and I hope last) place where we mix up
global and local porfile.

Bootstrapped/regtested x86_64-linux, comitted.

Honza

	* profile-count.h (profile_count::operator<): Use IPA value for
	comparsion.
	(profile_count::operator>): Likewise.
	(profile_count::operator<=): Likewise.
	(profile_count::operator>=): Likewise.
	* predict.c (maybe_hot_count_p): Do not convert to gcov_type.
diff mbox series

Patch

Index: profile-count.h
===================================================================
--- profile-count.h	(revision 278877)
+++ profile-count.h	(working copy)
@@ -930,14 +930,14 @@  public:
     {
       gcc_checking_assert (ipa_p ());
       gcc_checking_assert (other >= 0);
-      return initialized_p () && m_val < (uint64_t) other;
+      return ipa ().initialized_p () && ipa ().m_val < (uint64_t) other;
     }
 
   bool operator> (const gcov_type other) const
     {
       gcc_checking_assert (ipa_p ());
       gcc_checking_assert (other >= 0);
-      return initialized_p () && m_val > (uint64_t) other;
+      return ipa ().initialized_p () && ipa ().m_val > (uint64_t) other;
     }
 
   bool operator<= (const profile_count &other) const
@@ -968,14 +968,14 @@  public:
     {
       gcc_checking_assert (ipa_p ());
       gcc_checking_assert (other >= 0);
-      return initialized_p () && m_val <= (uint64_t) other;
+      return ipa ().initialized_p () && ipa ().m_val <= (uint64_t) other;
     }
 
   bool operator>= (const gcov_type other) const
     {
       gcc_checking_assert (ipa_p ());
       gcc_checking_assert (other >= 0);
-      return initialized_p () && m_val >= (uint64_t) other;
+      return ipa ().initialized_p () && ipa ().m_val >= (uint64_t) other;
     }
 
   /* Return true when value is not zero and can be used for scaling. 
Index: predict.c
===================================================================
--- predict.c	(revision 278877)
+++ predict.c	(working copy)
@@ -184,7 +184,7 @@  maybe_hot_count_p (struct function *fun,
   /* Code executed at most once is not hot.  */
   if (count <= MAX (profile_info ? profile_info->runs : 1, 1))
     return false;
-  return (count.to_gcov_type () >= get_hot_bb_threshold ());
+  return (count >= get_hot_bb_threshold ());
 }
 
 /* Return true if basic block BB of function FUN can be CPU intensive