aboutsummaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-06-23 07:47:16 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-06-23 07:47:16 -0400
commitbd5f197aa10b21fee7b8ca995481e1b9a15b196a (patch)
treee5e36c97515a82acc2d639b78a30a53e5f2aff3b /gcc/local-alloc.c
parentc307c23778c34eb7eae050de7c09f108e33c436f (diff)
downloadgcc-bd5f197aa10b21fee7b8ca995481e1b9a15b196a.zip
gcc-bd5f197aa10b21fee7b8ca995481e1b9a15b196a.tar.gz
gcc-bd5f197aa10b21fee7b8ca995481e1b9a15b196a.tar.bz2
(scratch_block, scratch_list{,_length}, scratch_index): New variables.
(local_alloc): Allocate and initialize them. (block_alloc): Only allocate a SCRATCH if it can fit in the block we make. Don't mark regs used in SCRATCH live here; instead, make entry in new tables. From-SVN: r4713
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 6af0934..a576efa 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -227,6 +227,11 @@ static HARD_REG_SET regs_live;
static HARD_REG_SET *regs_live_at;
+int *scratch_block;
+rtx *scratch_list;
+int scratch_list_length;
+static int scratch_index;
+
/* Communicate local vars `insn_number' and `insn'
from `block_alloc' to `reg_is_set', `wipe_dead_reg', and `alloc_qty'. */
static int this_insn_number;
@@ -395,6 +400,13 @@ local_alloc ()
See the declarations of these variables, above,
for what they mean. */
+ scratch_list_length = max_qty;
+ scratch_list = (rtx *) xmalloc (scratch_list_length * sizeof (rtx));
+ bzero (scratch_list, scratch_list_length * sizeof (rtx));
+ scratch_block = (int *) xmalloc (scratch_list_length * sizeof (int));
+ bzero (scratch_block, scratch_list_length * sizeof (int));
+ scratch_index = 0;
+
qty_phys_reg = (short *) alloca (max_qty * sizeof (short));
qty_phys_copy_sugg = (HARD_REG_SET *) alloca (max_qty * sizeof (HARD_REG_SET));
qty_phys_has_copy_sugg = (char *) alloca (max_qty * sizeof (char));
@@ -1333,7 +1345,8 @@ block_alloc (b)
if (insn_code_number >= 0)
for (i = 0; i < insn_n_operands[insn_code_number]; i++)
- if (GET_CODE (recog_operand[i]) == SCRATCH)
+ if (GET_CODE (recog_operand[i]) == SCRATCH
+ && scratch_index < scratch_list_length - 1)
alloc_qty_for_scratch (recog_operand[i], i, insn,
insn_code_number, insn_number);
#endif
@@ -1450,13 +1463,13 @@ block_alloc (b)
reg_renumber[i] = qty_phys_reg[q] + reg_offset[i];
if (qty_scratch_rtx[q])
{
+ if (GET_CODE (qty_scratch_rtx[q]) == REG)
+ abort ();
PUT_CODE (qty_scratch_rtx[q], REG);
REGNO (qty_scratch_rtx[q]) = qty_phys_reg[q];
- for (i = HARD_REGNO_NREGS (qty_phys_reg[q],
- GET_MODE (qty_scratch_rtx[q])) - 1;
- i >= 0; i--)
- regs_ever_live[qty_phys_reg[q] + i] = 1;
+ scratch_block[scratch_index] = b;
+ scratch_list[scratch_index++] = qty_scratch_rtx[q];
/* Must clear the USED field, because it will have been set by
copy_rtx_if_shared, but the leaf_register code expects that