diff options
author | Jan Hubicka <jh@suse.cz> | 2023-08-03 22:42:27 +0200 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2023-08-03 22:42:27 +0200 |
commit | 93236ad9e8fa9208e754e8806dc369e1a79dbdf7 (patch) | |
tree | b9deeab6fd9c764297ec89224e03542a7dad760a | |
parent | c83528d2367b353156e27af50b63d1c14686f778 (diff) | |
download | gcc-93236ad9e8fa9208e754e8806dc369e1a79dbdf7.zip gcc-93236ad9e8fa9208e754e8806dc369e1a79dbdf7.tar.gz gcc-93236ad9e8fa9208e754e8806dc369e1a79dbdf7.tar.bz2 |
Fix profiledbootstrap
Profiledbootstrap fails with ICE in update_loop_exit_probability_scale_dom_bbs
called from loop unroling.
The reason is that under relatively rare situations, we may run into case where
loop has multiple exits and all are considered as likely but then we scale down
the profile and one of the exits becomes unlikely.
We pass around unadjusted_exit_count to scale exit probability correctly. In this
case we may end up using uninitialized value and profile-count type intentionally
bombs on that.
gcc/ChangeLog:
PR bootstrap/110857
* cfgloopmanip.cc (scale_loop_profile): (Un)initialize
unadjusted_exit_count.
-rw-r--r-- | gcc/cfgloopmanip.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cfgloopmanip.cc b/gcc/cfgloopmanip.cc index 86360b5..b237ad4 100644 --- a/gcc/cfgloopmanip.cc +++ b/gcc/cfgloopmanip.cc @@ -742,7 +742,7 @@ scale_loop_profile (class loop *loop, profile_probability p, /* In a consistent profile unadjusted_exit_count should be same as count_in, however to preserve as much of the original info, avoid recomputing it. */ - profile_count unadjusted_exit_count; + profile_count unadjusted_exit_count = profile_count::uninitialized (); if (exit_edge) unadjusted_exit_count = exit_edge->count (); scale_loop_frequencies (loop, scale_prob); |