From: Jeffrey A Law Date: Mon, 10 May 1999 12:05:24 +0000 (+0000) Subject: optabs.c (emit_cmp_and_jump_insns): Handle the case where both operands to the compar... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0ca40216d79d8b9bcf03e9c51d00357621750781;p=platform%2Fupstream%2Fgcc.git optabs.c (emit_cmp_and_jump_insns): Handle the case where both operands to the comparison are constants. * optabs.c (emit_cmp_and_jump_insns): Handle the case where both operands to the comparison are constants. From-SVN: r26860 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 50be905..f62484d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +Mon May 10 12:59:20 1999 Jeffrey A Law (law@cygnus.com) + + * optabs.c (emit_cmp_and_jump_insns): Handle the case where both + operands to the comparison are constants. + Mon May 10 07:28:10 1999 Bruce Korb * fixinc/inclhack.def(arm_norcroft_hint): check before fixing diff --git a/gcc/optabs.c b/gcc/optabs.c index 541471e..75f224c 100644 --- a/gcc/optabs.c +++ b/gcc/optabs.c @@ -2976,6 +2976,15 @@ emit_cmp_and_jump_insns (x, y, comparison, size, mode, unsignedp, align, label) op0 = x; op1 = y; } + +#ifdef HAVE_cc0 + /* If OP0 is still a constant, then both X and Y must be constants. Force + X into a register to avoid aborting in emit_cmp_insn due to non-canonical + RTL. */ + if (CONSTANT_P (op0)) + op0 = force_reg (mode, op0); +#endif + emit_cmp_insn (op0, op1, comparison, size, mode, unsignedp, align); if (unsignedp)