]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
reg-stack.c (subst_stack_regs_pat): Make sure the top of stack is the destination...
authorH.J. Lu <hjl@gnu.org>
Mon, 8 Jun 1998 01:53:56 +0000 (01:53 +0000)
committerJeff Law <law@gcc.gnu.org>
Mon, 8 Jun 1998 01:53:56 +0000 (19:53 -0600)
        * reg-stack.c (subst_stack_regs_pat): Make sure the top of
        stack is the destination for conditional move insn.

From-SVN: r20324

gcc/ChangeLog
gcc/reg-stack.c

index 39483849735e3df3209ac928fa5109e67da8b1d4..627a3e9c0e5fb9703e596ab917e5aeaad8d25734 100644 (file)
@@ -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.
index 6496badbef8b388ca34dccc346b3b4620df6f38b..ab400c51f1d12df09ebedd78b1ff7114b732aab6 100644 (file)
@@ -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));