builtins.c (expand_builtin_expect_jump): Disable if the expression can't be re-evaluated.
authorRichard Henderson <rth@redhat.com>
Sun, 24 Jun 2001 16:09:29 +0000 (09:09 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sun, 24 Jun 2001 16:09:29 +0000 (09:09 -0700)
        * builtins.c (expand_builtin_expect_jump): Disable if the
        expression can't be re-evaluated.

From-SVN: r43543

gcc/ChangeLog
gcc/builtins.c

index d0ad198fa1708269e55390aedfcb2a876bb213d2..ded2942bc1ff2d81bbb9371f599fab672a1854c8 100644 (file)
@@ -1,3 +1,8 @@
+2001-06-24  Richard Henderson  <rth@redhat.com>
+
+       * builtins.c (expand_builtin_expect_jump): Disable if the
+       expression can't be re-evaluated.
+
 2001-06-24  Nick Clifton  <nickc@cambridge.redhat.com>
 
        * config/arm/arm.c (arm_compute_save_reg_mask): For FIQ interrupt
index 3e4ef1553eefd67f8d6c0b6e827a91178adbddfd..4fc329f93d33b1c67772ad44cb7bcd04b6d094ee 100644 (file)
@@ -3304,6 +3304,22 @@ expand_builtin_expect_jump (exp, if_false_label, if_true_label)
       int j;
       int num_jumps = 0;
 
+      /* If we fail to locate an appropriate conditional jump, we'll
+        fall back to normal evaluation.  Ensure that the expression
+        can be re-evaluated.  */
+      switch (unsafe_for_reeval (arg0))
+       {
+       case 0: /* Safe.  */
+         break;
+
+       case 1: /* Mildly unsafe.  */
+         arg0 = unsave_expr (arg0);
+         break;
+
+       case 2: /* Wildly unsafe.  */
+         return NULL_RTX;
+       }
+
       /* Expand the jump insns.  */
       start_sequence ();
       do_jump (arg0, if_false_label, if_true_label);