https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63432
--- Comment #9 from H.J. Lu <hjl.tools at gmail dot com> --- This works for me: diff --git a/gcc/tree-ssa-threadupdate.c b/gcc/tree-ssa-threadupdate.c index d660fdb..c6f3956 100644 --- a/gcc/tree-ssa-threadupdate.c +++ b/gcc/tree-ssa-threadupdate.c @@ -874,7 +874,8 @@ recompute_probabilities (basic_block bb) if (bb->count) esucc->probability = GCOV_COMPUTE_SCALE (esucc->count, bb->count); - if (esucc->probability > REG_BR_PROB_BASE) + if (esucc->probability < 0 + || esucc->probability > REG_BR_PROB_BASE) { /* Can happen with missing/guessed probabilities, since we may determine that more is flowing along duplicated