summaryrefslogtreecommitdiff
path: root/gcc/jump.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-02-11 19:35:57 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>2000-02-11 19:35:57 +0000
commit3cc4218a4239d4c95cdcbb19082c73a5b125f4aa (patch)
tree4f7c1de9d41848cde64412c8651f3224743ee4d4 /gcc/jump.c
parentffb6162735a81d82e931314fe2bde06d9ea4a94e (diff)
downloadgcc-3cc4218a4239d4c95cdcbb19082c73a5b125f4aa.tar.gz
* jump.c (jump_optimize_1): The first operand in a relational
can be a CONST_INT. * optabs.c (emit_conditional_move): Handle relationals which have a known true/false result. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31929 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/jump.c')
-rw-r--r--gcc/jump.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/jump.c b/gcc/jump.c
index fcabc27d349..d816b126ac4 100644
--- a/gcc/jump.c
+++ b/gcc/jump.c
@@ -1305,10 +1305,16 @@ jump_optimize_1 (f, cross_jump, noop_moves, after_regscan, mark_labels_only)
insn? After all, we're going to delete it. We'd have
to modify emit_conditional_move to take a comparison rtx
instead or write a new function. */
- cond0 = gen_reg_rtx (GET_MODE (XEXP (temp4, 0)));
+
/* We want the target to be able to simplify comparisons with
zero (and maybe other constants as well), so don't create
pseudos for them. There's no need to either. */
+ if (GET_CODE (XEXP (temp4, 0)) == CONST_INT
+ || GET_CODE (XEXP (temp4, 0)) == CONST_DOUBLE)
+ cond0 = XEXP (temp4, 0);
+ else
+ cond0 = gen_reg_rtx (GET_MODE (XEXP (temp4, 0)));
+
if (GET_CODE (XEXP (temp4, 1)) == CONST_INT
|| GET_CODE (XEXP (temp4, 1)) == CONST_DOUBLE)
cond1 = XEXP (temp4, 1);