* regclass.c (allocate_reg_info): Respect MIN when clearing data.
authorRichard Henderson <rth@cygnus.com>
Mon, 17 Aug 1998 02:04:53 +0000 (19:04 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Mon, 17 Aug 1998 02:04:53 +0000 (19:04 -0700)
From-SVN: r21770

gcc/ChangeLog
gcc/regclass.c

index 68164b61f07710dc9cc36ef1431adb6b36cddd4e..cc9cd63e025e147abfd6fca9f5fb61917f5e3d53 100644 (file)
@@ -1,3 +1,7 @@
+Mon Aug 17 02:03:55 1998  Richard Henderson  <rth@cygnus.com>
+
+       * regclass.c (allocate_reg_info): Respect MIN when clearing data.
+
 Sun Aug 16 17:37:06 1998  David S. Miller  <davem@pierdol.cobaltmicro.com>
 
        * config/sparc/sparc.c (ultra_code_from_mask,
index 256d92bcc9ee84699f00941fdadba16bc7365063..40bdc72f1cbb08bf51672ea3182fbb0bfb178f60 100644 (file)
@@ -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;