From: Richard Henderson Date: Sun, 24 Jun 2001 16:09:29 +0000 (-0700) Subject: builtins.c (expand_builtin_expect_jump): Disable if the expression can't be re-evaluated. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c1c455a71d130dcbf413f0c9451bcc8287d24b41;p=gcc.git builtins.c (expand_builtin_expect_jump): Disable if the expression can't be re-evaluated. * builtins.c (expand_builtin_expect_jump): Disable if the expression can't be re-evaluated. From-SVN: r43543 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d0ad198fa17..ded2942bc1f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-06-24 Richard Henderson + + * builtins.c (expand_builtin_expect_jump): Disable if the + expression can't be re-evaluated. + 2001-06-24 Nick Clifton * config/arm/arm.c (arm_compute_save_reg_mask): For FIQ interrupt diff --git a/gcc/builtins.c b/gcc/builtins.c index 3e4ef1553ee..4fc329f93d3 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -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);