aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hjl@gnu.org>1998-06-08 01:53:56 +0000
committerJeff Law <law@gcc.gnu.org>1998-06-07 19:53:56 -0600
commit49fa02d9d67616530d588d5d4f0ac37be10ff70d (patch)
tree5a3b17b74ce26ff9a5e002fcfe7b03c03a38e520 /gcc
parent52267fcbd179e9ce12ca33a31c5b911d21deffee (diff)
downloadgcc-49fa02d9d67616530d588d5d4f0ac37be10ff70d.zip
gcc-49fa02d9d67616530d588d5d4f0ac37be10ff70d.tar.gz
gcc-49fa02d9d67616530d588d5d4f0ac37be10ff70d.tar.bz2
reg-stack.c (subst_stack_regs_pat): Make sure the top of stack is the destination for conditional move insn.
* reg-stack.c (subst_stack_regs_pat): Make sure the top of stack is the destination for conditional move insn. From-SVN: r20324
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/reg-stack.c9
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3948384..627a3e9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jun 8 02:49:23 1998 H.J. Lu (hjl@gnu.org)
+
+ * reg-stack.c (subst_stack_regs_pat): Make sure the top of
+ stack is the destination for conditional move insn.
+
Mon Jun 8 01:21:13 1998 Jason Merrill <jason@yorick.cygnus.com>
* tree.h (TREE_VEC_END): Cast unused value to void.
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 6496bad..ab400c5 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -2344,6 +2344,15 @@ subst_stack_regs_pat (insn, regstack, pat)
case IF_THEN_ELSE:
/* This insn requires the top of stack to be the destination. */
+ /* If the comparison operator is an FP comparison operator,
+ it is handled correctly by compare_for_stack_reg () who
+ will move the destination to the top of stack. But if the
+ comparison operator is not an FP comparison operator, we
+ have to handle it here. */
+ if (get_hard_regnum (regstack, *dest) >= FIRST_STACK_REG
+ && REGNO (*dest) != regstack->reg[regstack->top])
+ emit_swap_insn (insn, regstack, *dest);
+
src1 = get_true_reg (&XEXP (SET_SRC (pat), 1));
src2 = get_true_reg (&XEXP (SET_SRC (pat), 2));