aboutsummaryrefslogtreecommitdiff
path: root/gcc/optabs.c
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-05-10 12:05:24 +0000
committerJeff Law <law@gcc.gnu.org>1999-05-10 06:05:24 -0600
commit0ca40216d79d8b9bcf03e9c51d00357621750781 (patch)
treedc70c5ce9029ea09e374ec66cc46cb97a0bcc102 /gcc/optabs.c
parentf2646f9c9a772664d468b288873de38175c1e1ec (diff)
downloadgcc-0ca40216d79d8b9bcf03e9c51d00357621750781.zip
gcc-0ca40216d79d8b9bcf03e9c51d00357621750781.tar.gz
gcc-0ca40216d79d8b9bcf03e9c51d00357621750781.tar.bz2
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
Diffstat (limited to 'gcc/optabs.c')
-rw-r--r--gcc/optabs.c9
1 files changed, 9 insertions, 0 deletions
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)