diff options
author | Teresa Johnson <tejohnson@google.com> | 2014-10-15 15:45:59 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@gcc.gnu.org> | 2014-10-15 15:45:59 +0000 |
commit | e631038f4b5ca08723d34c5523e47dc8c80ce602 (patch) | |
tree | 49744fbd0bbcba1f96ef2997f03754679d3cfcee /gcc/tree-ssa-threadupdate.c | |
parent | bb8c2886dbf838805777d2c7952f46bbeba7987f (diff) | |
download | gcc-e631038f4b5ca08723d34c5523e47dc8c80ce602.zip gcc-e631038f4b5ca08723d34c5523e47dc8c80ce602.tar.gz gcc-e631038f4b5ca08723d34c5523e47dc8c80ce602.tar.bz2 |
re PR bootstrap/63432 (profiledbootstrap failure with bootstrap-lto)
2014-10-15 Teresa Johnson <tejohnson@google.com>
PR bootstrap/63432
* tree-ssa-threadupdate.c (recompute_probabilities): Better
overflow checking.
From-SVN: r216269
Diffstat (limited to 'gcc/tree-ssa-threadupdate.c')
-rw-r--r-- | gcc/tree-ssa-threadupdate.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index 125f6f8..2be3ab2 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -871,21 +871,23 @@ recompute_probabilities (basic_block bb) edge_iterator ei; FOR_EACH_EDGE (esucc, ei, bb->succs) { - if (bb->count) + if (!bb->count) + continue; + + /* Prevent overflow computation due to insane profiles. */ + if (esucc->count < bb->count) esucc->probability = GCOV_COMPUTE_SCALE (esucc->count, bb->count); - if (esucc->probability > REG_BR_PROB_BASE) - { - /* Can happen with missing/guessed probabilities, since we - may determine that more is flowing along duplicated - path than joiner succ probabilities allowed. - Counts and freqs will be insane after jump threading, - at least make sure probability is sane or we will - get a flow verification error. - Not much we can do to make counts/freqs sane without - redoing the profile estimation. */ - esucc->probability = REG_BR_PROB_BASE; - } + else + /* Can happen with missing/guessed probabilities, since we + may determine that more is flowing along duplicated + path than joiner succ probabilities allowed. + Counts and freqs will be insane after jump threading, + at least make sure probability is sane or we will + get a flow verification error. + Not much we can do to make counts/freqs sane without + redoing the profile estimation. */ + esucc->probability = REG_BR_PROB_BASE; } } |