diff options
author | Jeffrey A Law <law@cygnus.com> | 2000-02-11 12:35:57 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2000-02-11 12:35:57 -0700 |
commit | 144a5f9d4507713f644f15a5ba4795dec3663435 (patch) | |
tree | 4f7c1de9d41848cde64412c8651f3224743ee4d4 | |
parent | 2dd8bc01663b0ff2c5dd586102dfe270b145fc45 (diff) | |
download | gcc-144a5f9d4507713f644f15a5ba4795dec3663435.zip gcc-144a5f9d4507713f644f15a5ba4795dec3663435.tar.gz gcc-144a5f9d4507713f644f15a5ba4795dec3663435.tar.bz2 |
jump.c (jump_optimize_1): The first operand in a relational can be a CONST_INT.
* 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.
From-SVN: r31929
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/jump.c | 8 | ||||
-rw-r--r-- | gcc/optabs.c | 6 |
3 files changed, 18 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5feeef0..a4cdc73 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Feb 11 12:30:53 2000 Jeffrey A Law (law@cygnus.com) + + * 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. + 2000-02-11 Geoff Keating <geoffk@cygnus.com> * function.c (thread_prologue_and_epilogue_insns): Don't insert @@ -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); diff --git a/gcc/optabs.c b/gcc/optabs.c index df08316..9ce0c92 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -3593,9 +3593,11 @@ emit_conditional_move (target, code, op0, op1, cmode, op2, op3, mode, = compare_from_rtx (op0, op1, code, unsignedp, cmode, NULL_RTX, 0); /* ??? Watch for const0_rtx (nop) and const_true_rtx (unconditional)? */ + /* We can get const0_rtx or const_true_rtx in some circumstances. Just + return NULL and let the caller figure out how best to deal with this + situation. */ if (GET_CODE (comparison) != code) - /* This shouldn't happen. */ - abort (); + return NULL_RTX; insn = GEN_FCN (icode) (subtarget, comparison, op2, op3); |