reg-stack.c (subst_stack_regs_pat): <UNSPEC_SIN, UNSPEC_COS, UNSPEC_FRNDINT, UNSPEC_F...
authorUros Bizjak <uros@kss-loka.si>
Fri, 30 Apr 2004 05:31:48 +0000 (07:31 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 30 Apr 2004 05:31:48 +0000 (07:31 +0200)
2004-04-30  Uros Bizjak  <uros@kss-loka.si>

        * reg-stack.c (subst_stack_regs_pat): <UNSPEC_SIN, UNSPEC_COS,
        UNSPEC_FRNDINT, UNSPEC_F2XM1>: abort() if src1 dies.
        <UNSPEC_SINCOS_COS, UNSPEC_TAN_ONE, UNSPEC_XTRACT_FRACT>: Same.
        <UNSPEC_SINCOS_SIN, UNSPEC_TAN_TAN, UNSPEC_XTRACT_EXP>: Same.

From-SVN: r81324

gcc/ChangeLog
gcc/reg-stack.c

index 7460ff7fc0922954022722732c82199c92c76f6c..22f2d773d2b193221bddbfa3e9a145c3cf813917 100644 (file)
@@ -1,3 +1,10 @@
+2004-04-30  Uros Bizjak  <uros@kss-loka.si>
+
+        * reg-stack.c (subst_stack_regs_pat): <UNSPEC_SIN, UNSPEC_COS,
+        UNSPEC_FRNDINT, UNSPEC_F2XM1>: abort() if src1 dies.
+        <UNSPEC_SINCOS_COS, UNSPEC_TAN_ONE, UNSPEC_XTRACT_FRACT>: Same.
+        <UNSPEC_SINCOS_SIN, UNSPEC_TAN_TAN, UNSPEC_XTRACT_EXP>: Same.
+
 2004-04-29  Richard Guenther  <richard.guenther@uni-tuebingen.de>
 
        * commom.opt (Wfatal-errors): Add it.
index 2836e63d7ed47b84a1500e5735cc8fa17411f47e..6d1018419937d3e6a70acba28ebe9b85cc45f953 100644 (file)
@@ -1733,18 +1733,15 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
 
                emit_swap_insn (insn, regstack, *src1);
 
+               /* Input should never die, it is
+                  replaced with output.  */
                src1_note = find_regno_note (insn, REG_DEAD, REGNO (*src1));
+               if (src1_note)
+                 abort();
 
                if (STACK_REG_P (*dest))
                  replace_reg (dest, FIRST_STACK_REG);
 
-               if (src1_note)
-                 {
-                   replace_reg (&XEXP (src1_note, 0), FIRST_STACK_REG);
-                   regstack->top--;
-                   CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (*src1));
-                 }
-
                replace_reg (src1, FIRST_STACK_REG);
                break;
 
@@ -1849,7 +1846,11 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
 
                emit_swap_insn (insn, regstack, *src1);
 
+               /* Input should never die, it is
+                  replaced with output.  */
                src1_note = find_regno_note (insn, REG_DEAD, REGNO (*src1));
+               if (src1_note)
+                 abort();
 
                /* Push the result back onto stack. Empty stack slot
                   will be filled in second part of insn. */
@@ -1859,12 +1860,6 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
                  replace_reg (dest, FIRST_STACK_REG);
                }
 
-               if (src1_note)
-                 {
-                   replace_reg (&XEXP (src1_note, 0), FIRST_STACK_REG);
-                   regstack->top--;
-                   CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (*src1));
-                 }
                replace_reg (src1, FIRST_STACK_REG);
                break;
 
@@ -1878,7 +1873,11 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
 
                emit_swap_insn (insn, regstack, *src1);
 
+               /* Input should never die, it is
+                  replaced with output.  */
                src1_note = find_regno_note (insn, REG_DEAD, REGNO (*src1));
+               if (src1_note)
+                 abort();
 
                /* Push the result back onto stack. Fill empty slot from
                   first part of insn and fix top of stack pointer.  */
@@ -1890,13 +1889,6 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
                  regstack->top++;
                }
 
-               if (src1_note)
-                 {
-                   replace_reg (&XEXP (src1_note, 0), FIRST_STACK_REG);
-                   regstack->top--;
-                   CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (*src1));
-                 }
-
                replace_reg (src1, FIRST_STACK_REG);
                break;