Message ID | ZMJ9Df2xIWL6wD35@kam.mff.cuni.cz |
---|---|
State | New |
Headers | show |
Series | Fix profile_count::apply_probability | expand |
diff --git a/gcc/profile-count.h b/gcc/profile-count.h index bf1136782a3..e860c5db540 100644 --- a/gcc/profile-count.h +++ b/gcc/profile-count.h @@ -1129,11 +1132,11 @@ public: /* Scale counter according to PROB. */ profile_count apply_probability (profile_probability prob) const { - if (*this == zero ()) + if (*this == zero () || prob == profile_probability::always ()) return *this; if (prob == profile_probability::never ()) return zero (); - if (!initialized_p ()) + if (!initialized_p () || !prob.initialized_p ()) return uninitialized (); profile_count ret; uint64_t tmp;