summaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1993-08-03 19:38:40 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1993-08-03 19:38:40 +0000
commit0d1890ed91f185be9756ff583514561e85ab18b7 (patch)
tree3a0c14987ded73945de8dbdc3416c3a96dfd57ed /gcc/local-alloc.c
parenta8c3b19989838bf2ba43baa07c14e8ff4d8fb0f4 (diff)
downloadgcc-0d1890ed91f185be9756ff583514561e85ab18b7.tar.gz
(block_alloc): Don't attempt to allocate a
SCRATCH if it will not fit in scratch_list. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@5058 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 5d7b0e6da9a..00c06e804ad 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -1099,6 +1099,9 @@ block_alloc (b)
int max_uid = get_max_uid ();
int *qty_order;
int no_conflict_combined_regno = -1;
+ /* Counter to prevent allocating more SCRATCHes than can be stored
+ in SCRATCH_LIST. */
+ int scratches_allocated = scratch_index;
/* Count the instructions in the basic block. */
@@ -1341,7 +1344,7 @@ 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
- && scratch_index < scratch_list_length - 1)
+ && scratches_allocated++ < scratch_list_length)
alloc_qty_for_scratch (recog_operand[i], i, insn,
insn_code_number, insn_number);