diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-24 16:09:29 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-06-24 16:09:29 +0000 |
commit | 1dc55962e544b7d2c57abb858ad21394fbedc54c (patch) | |
tree | 072c952c07efd8ca1810f95ac5c40173d17818a7 /gcc/builtins.c | |
parent | 2d9065d39c691e31f14f89608132ec200db27fa1 (diff) | |
download | gcc-1dc55962e544b7d2c57abb858ad21394fbedc54c.tar.gz |
* builtins.c (expand_builtin_expect_jump): Disable if the
expression can't be re-evaluated.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@43543 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r-- | gcc/builtins.c | 16 |
1 files changed, 16 insertions, 0 deletions
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); |