From: Jan Hubicka Date: Sun, 6 Jul 2025 08:48:46 +0000 (+0200) Subject: Fix overflow check in profile_count::operator* (const sreal &num). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1757c320badc92c0628eafcd07d54585659692ed;p=thirdparty%2Fgcc.git Fix overflow check in profile_count::operator* (const sreal &num). 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 ();