diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2025-07-06 10:48:46 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@ucw.cz> | 2025-07-06 10:49:14 +0200 |
commit | 1757c320badc92c0628eafcd07d54585659692ed (patch) | |
tree | a04822aedd03c0ed555925d9daa3dce5e8e22b23 /gcc | |
parent | 5599f8a6808aae2151d7df6fd7339e9e31c01844 (diff) | |
download | gcc-1757c320badc92c0628eafcd07d54585659692ed.zip gcc-1757c320badc92c0628eafcd07d54585659692ed.tar.gz gcc-1757c320badc92c0628eafcd07d54585659692ed.tar.bz2 |
Fix overflow check in profile_count::operator* (const sreal &num).
gcc/ChangeLog:
* profile-count.cc (profile_count::operator*): fix overflow check.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/profile-count.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/profile-count.cc b/gcc/profile-count.cc index 190bbeb..2147700 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 (); |