diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-22 18:34:59 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-04-22 18:34:59 +0000 |
commit | 5e084fd085a4ab185b7476d144157bbf1eacfef5 (patch) | |
tree | b190cb47708cbc1a7a252efd379c6490dbfa1776 /gcc/predict.c | |
parent | a3eb58a5497a3220f9bfd7d036395173c8c6a1b7 (diff) | |
download | gcc-5e084fd085a4ab185b7476d144157bbf1eacfef5.tar.gz |
* predict.c (expected_value_to_br_prob): Don't bomb if op1 of
the collected condition is not a constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33340 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/predict.c')
-rw-r--r-- | gcc/predict.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/predict.c b/gcc/predict.c index 7ed470929af..57b71e2d9c2 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -248,9 +248,19 @@ expected_value_to_br_prob () } /* Collect the branch condition, hopefully relative to EV_REG. */ + /* ??? At present we'll miss things like + (expected_value (eq r70 0)) + (set r71 -1) + (set r80 (lt r70 r71)) + (set pc (if_then_else (ne r80 0) ...)) + as canonicalize_condition will render this to us as + (lt r70, r71) + Could use cselib to try and reduce this further. */ cond = XEXP (SET_SRC (PATTERN (insn)), 0); cond = canonicalize_condition (insn, cond, 0, NULL, ev_reg); - if (! cond || XEXP (cond, 0) != ev_reg) + if (! cond + || XEXP (cond, 0) != ev_reg + || GET_CODE (XEXP (cond, 1)) != CONST_INT) continue; /* Substitute and simplify. Given that the expression we're |