summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-10 12:05:24 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-05-10 12:05:24 +0000
commitdfd1e7f2aa445c0175ae9c0abc29d17fc852af35 (patch)
treedc70c5ce9029ea09e374ec66cc46cb97a0bcc102
parent9395e1ee61176aa07a4c3a519f70d950c5c99527 (diff)
downloadppe42-gcc-dfd1e7f2aa445c0175ae9c0abc29d17fc852af35.tar.gz
ppe42-gcc-dfd1e7f2aa445c0175ae9c0abc29d17fc852af35.zip
* optabs.c (emit_cmp_and_jump_insns): Handle the case where both
operands to the comparison are constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26860 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/optabs.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 50be90525cb..f62484d5503 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 <autogen@autogen.freeservers.com>
* fixinc/inclhack.def(arm_norcroft_hint): check before fixing
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 541471e0910..75f224c4809 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)
OpenPOWER on IntegriCloud