summaryrefslogtreecommitdiff
path: root/gcc/regclass.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-08-17 02:04:53 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>1998-08-17 02:04:53 +0000
commit210fd9884daf299f6359c216bc5d1c79e38222b8 (patch)
treefb3b230b55bbbbf764342c91cbe29e3e6f9ffaf8 /gcc/regclass.c
parente66eb2861a16089ff7fbf37e57f1be7a5169649f (diff)
downloadgcc-210fd9884daf299f6359c216bc5d1c79e38222b8.tar.gz
* regclass.c (allocate_reg_info): Respect MIN when clearing data.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21770 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/regclass.c')
-rw-r--r--gcc/regclass.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/regclass.c b/gcc/regclass.c
index 256d92bcc9e..40bdc72f1cb 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -1866,18 +1866,19 @@ allocate_reg_info (num_regs, new_p, renumber_p)
size_t max_index = reg_data->max_index;
reg_next = reg_data->next;
- if (min_index <= regno_allocated)
+ if (min <= max_index)
{
size_t max = max_index;
- if (max > regno_allocated)
- max = regno_allocated;
+ size_t local_min = min - min_index;
+ if (min < min_index)
+ local_min = 0;
if (!reg_data->used_p) /* page just allocated with calloc */
reg_data->used_p = 1; /* no need to zero */
else
- bzero ((char *) &reg_data->data,
- sizeof (reg_info) * (max - min_index + 1));
+ bzero ((char *) &reg_data->data[local_min],
+ sizeof (reg_info) * (max - min_index - local_min + 1));
- for (i = min_index; i <= max; i++)
+ for (i = min_index+local_min; i <= max; i++)
{
VARRAY_REG (reg_n_info, i) = &reg_data->data[i-min_index];
REG_BASIC_BLOCK (i) = REG_BLOCK_UNKNOWN;