diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1993-08-03 12:38:40 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1993-08-03 12:38:40 -0700 |
commit | 2a81034facfe36e339c46c689831fb9fbb89a3b8 (patch) | |
tree | 3a0c14987ded73945de8dbdc3416c3a96dfd57ed /gcc/local-alloc.c | |
parent | cf0e292fd009eaf1ade6fc0c7344fa77ff8ac529 (diff) | |
download | gcc-2a81034facfe36e339c46c689831fb9fbb89a3b8.zip gcc-2a81034facfe36e339c46c689831fb9fbb89a3b8.tar.gz gcc-2a81034facfe36e339c46c689831fb9fbb89a3b8.tar.bz2 |
(block_alloc): Don't attempt to allocate a
SCRATCH if it will not fit in scratch_list.
From-SVN: r5058
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r-- | gcc/local-alloc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 5d7b0e6..00c06e8 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); |