This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
new_ia32: More reg-stack changes
- To: gcc-patches at gcc dot gnu dot org
- Subject: new_ia32: More reg-stack changes
- From: Bernd Schmidt <bernds at cygnus dot co dot uk>
- Date: Thu, 29 Jul 1999 15:57:25 +0100 (BST)
This patch merges some more of the changes that were committed to
reg-stack.c this year into the new_ia32 branch.
John Wehle's patch may not be necessary anymore, but I suppose it can't hurt.
There is one other change which adds code to prevent insns being emitted
between cc0 setter and user. I've left this one out because the new ia32
backend doesn't use cc0.
Note: I tested this with make check, and on the first test run I got some
g77 failures. I could not reproduce them; I suspect my machine is a bit
flakey since there have been some other problems with it recently.
Are there any other known pieces that need to be merged into new_ia32?
Bernd
Sat Apr 10 20:09:55 1999 John Wehle (john@feith.com)
* reg-stack.c (delete_insn_for_stacker): Ensure that
the only side effects of a PARALLEL are clobbers.
(subst_stack_regs): Handle subst_stack_regs_pat deleting
a PARALLEL.
Thu Jun 10 20:37:57 1999 Mumit Khan <khan@xraylith.wisc.edu>
* reg-stack.c (stack_reg_life_analysis): Find all the RETURN insns.
Sun Jan 17 03:20:47 1999 H.J. Lu (hjl@gnu.org)
* reg-stack.c (subst_stack_regs_pat): Abort if the destination
of a FP conditional move is not on the FP register stack.
Index: reg-stack.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/reg-stack.c,v
retrieving revision 1.32.2.4
diff -u -p -r1.32.2.4 reg-stack.c
--- reg-stack.c 1999/07/27 09:43:11 1.32.2.4
+++ reg-stack.c 1999/07/29 09:17:37
@@ -528,7 +528,7 @@ reg_to_stack (first, file)
&& stack_regs_mentioned_p (PATTERN (insn)))
{
stack_reg_seen = 1;
- VARRAY_CHAR (stack_regs_mentioned_data, INSN_UID (insn)) = 1;
+ VARRAY_CHAR (stack_regs_mentioned_data, INSN_UID (insn)) = 1;
/* Note any register passing parameters. */
@@ -1263,7 +1263,7 @@ stack_reg_life_analysis (first, stackent
function into the epilogue. */
if (GET_CODE (block_end[blocks-1]) != JUMP_INSN
- || GET_CODE (PATTERN (block_end[blocks-1])) == RETURN)
+ || returnjump_p (block_end[blocks-1]))
mark_regs_pat (retvalue, block_out_reg_set+blocks-1);
}
}
@@ -1461,6 +1461,14 @@ static void
delete_insn_for_stacker (insn)
rtx insn;
{
+ int i;
+
+ /* Ensure that the side effects were clobbers when deleting a PARALLEL. */
+ if (GET_CODE (PATTERN (insn)) == PARALLEL)
+ for (i = 1; i < XVECLEN (PATTERN (insn), 0); i++)
+ if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) != CLOBBER)
+ abort ();
+
PUT_CODE (insn, NOTE);
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
NOTE_SOURCE_FILE (insn) = 0;
@@ -2172,6 +2180,10 @@ subst_stack_regs_pat (insn, regstack, pa
break;
case IF_THEN_ELSE:
+ /* DEST has to be on stack. */
+ if (get_hard_regnum (regstack, *dest) < FIRST_STACK_REG)
+ abort ();
+
/* This insn requires the top of stack to be the destination. */
/* If the comparison operator is an FP comparison operator,
@@ -2225,9 +2237,7 @@ subst_stack_regs_pat (insn, regstack, pa
}
}
- /* Make dest the top of stack. Add dest to regstack if not present. */
- if (get_hard_regnum (regstack, *dest) < FIRST_STACK_REG)
- regstack->reg[++regstack->top] = REGNO (*dest);
+ /* Make DEST the top of stack. */
SET_HARD_REG_BIT (regstack->reg_set, REGNO (*dest));
replace_reg (dest, FIRST_STACK_REG);
@@ -2587,8 +2597,14 @@ subst_stack_regs (insn, regstack)
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
if (stack_regs_mentioned_p (XVECEXP (PATTERN (insn), 0, i)))
- subst_stack_regs_pat (insn, regstack,
- XVECEXP (PATTERN (insn), 0, i));
+ {
+ subst_stack_regs_pat (insn, regstack,
+ XVECEXP (PATTERN (insn), 0, i));
+
+ /* subst_stack_regs_pat may have deleted a no-op insn. */
+ if (GET_CODE (insn) == NOTE)
+ break;
+ }
}
else
subst_stack_regs_pat (insn, regstack, PATTERN (insn));