diff options
Diffstat (limited to 'gcc/jump.c')
-rw-r--r-- | gcc/jump.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gcc/jump.c b/gcc/jump.c index 6b5fecdc91f..06b5bd58e26 100644 --- a/gcc/jump.c +++ b/gcc/jump.c @@ -4431,17 +4431,13 @@ invert_jump (jump, nlabel) if (redirect_jump (jump, nlabel)) { - if (flag_branch_probabilities) - { - rtx note = find_reg_note (jump, REG_BR_PROB, 0); - - /* An inverted jump means that a probability taken becomes a - probability not taken. Subtract the branch probability from the - probability base to convert it back to a taken probability. - (We don't flip the probability on a branch that's never taken. */ - if (note && XINT (XEXP (note, 0), 0) >= 0) - XINT (XEXP (note, 0), 0) = REG_BR_PROB_BASE - XINT (XEXP (note, 0), 0); - } + /* An inverted jump means that a probability taken becomes a + probability not taken. Subtract the branch probability from the + probability base to convert it back to a taken probability. */ + + rtx note = find_reg_note (jump, REG_BR_PROB, 0); + if (note) + XEXP (note, 0) = GEN_INT (REG_BR_PROB_BASE - INTVAL (XEXP (note, 0))); return 1; } |