]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix profile_count::apply_probability
authorJan Hubicka <jh@suse.cz>
Thu, 27 Jul 2023 13:57:54 +0000 (15:57 +0200)
committerJan Hubicka <jh@suse.cz>
Thu, 27 Jul 2023 13:57:54 +0000 (15:57 +0200)
commit499b8079a6419bb8082de062ec30772296c6700c
tree56d09a9fc2c639193c954614e5c43f8c4eae95f9
parentd1c072a1c3411a6fe29900750b38210af8451eeb
Fix profile_count::apply_probability

profile_count::apply_probability misses check for uninitialized probability which leads
to completely random results on applying uninitialized probability to initialized scale.
This can make difference when i.e. inlining -fno-guess-branch-probability function
to -fguess-branch-probability one.

gcc/ChangeLog:

* profile-count.h (profile_count::apply_probability): Fix
handling of uninitialized probabilities, optimize scaling
by probability 1.
gcc/profile-count.h