predict.c (expected_value_to_br_prob): Don't bomb if op1 of the collected condition...
authorRichard Henderson <rth@cygnus.com>
Sat, 22 Apr 2000 18:34:59 +0000 (11:34 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 22 Apr 2000 18:34:59 +0000 (11:34 -0700)
        * predict.c (expected_value_to_br_prob): Don't bomb if op1 of
        the collected condition is not a constant.

From-SVN: r33340

gcc/ChangeLog
gcc/predict.c

index 6ca390b1269e454830bfabe7654065e6c485f6ae..be2cd8a000a3591aae8959677ba988515b6355f5 100644 (file)
@@ -1,3 +1,8 @@
+2000-04-22  Richard Henderson  <rth@cygnus.com>
+
+       * predict.c (expected_value_to_br_prob): Don't bomb if op1 of
+       the collected condition is not a constant.
+
 2000-04-22  Gabriel Dos Reis  <gdr@codesourcery.com>
 
        * diagnostic.h: New file.
index 7ed470929afbab10e868f9dfff85ac14dee85035..57b71e2d9c289e4bff94473281cdc8bdc7f85f42 100644 (file)
@@ -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