Hi,
this fixes stupid mistake of mine in the overflow check for sreal
multiplication.  This was introduced this stage1 so unless we want to
backport the ipa-cp heuristics bugfixes, this does not need to go to
release branches.

Regtested and bootstrapped x86_64-linux.

Honza

gcc/ChangeLog:

        * profile-count.cc (profile_count::operator*): fix overflow check.

diff --git a/gcc/profile-count.cc b/gcc/profile-count.cc
index 190bbebb5a7..21477008b70 100644
--- a/gcc/profile-count.cc
+++ b/gcc/profile-count.cc
@@ -557,7 +557,7 @@ profile_count::operator* (const sreal &num) const
   sreal scaled = num * m_val;
   gcc_checking_assert (scaled >= 0);
   profile_count ret;
-  if (m_val > max_count)
+  if (scaled > max_count)
     ret.m_val = max_count;
   else
     ret.m_val = scaled.to_nearest_int ();

Reply via email to