]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
regclass.c (allocate_reg_info): Respect MIN when clearing data.
authorJeffrey A Law <law@cygnus.com>
Sun, 14 Feb 1999 22:39:22 +0000 (22:39 +0000)
committerJeff Law <law@gcc.gnu.org>
Sun, 14 Feb 1999 22:39:22 +0000 (15:39 -0700)
        Mon Aug 17 02:03:55 1998  Richard Henderson  <rth@cygnus.com>
        * regclass.c (allocate_reg_info): Respect MIN when clearing data.

From-SVN: r25207

gcc/ChangeLog
gcc/regclass.c

index a6e7d386fa3a895485684032ef9ccc0da39ffe29..9d7affa097765bbfb6cf5711e321c866d1d3d021 100644 (file)
@@ -1,5 +1,8 @@
 Sun Feb 14 23:05:34 1999  Jeffrey A Law  (law@cygnus.com)
 
+       Mon Aug 17 02:03:55 1998  Richard Henderson  <rth@cygnus.com>
+       * regclass.c (allocate_reg_info): Respect MIN when clearing data.
+
        * loop.c (scan_loop): Fix typo in last change.
 
 Sat Feb 13 11:53:12 1999  Jeffrey A Law  (law@cygnus.com)
index 3cad5aa54b143c283e15403c123da3bfddd5b299..25cac8f282fdea75dceaf67a6182894bd029e76a 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;