This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
jump failure w/ varray
- To: meissner at cygnus dot com, egcs-patches at cygnus dot com
- Subject: jump failure w/ varray
- From: Richard Henderson <rth at cygnus dot com>
- Date: Sun, 5 Jul 1998 01:11:25 -0700
- Reply-To: Richard Henderson <rth at cygnus dot com>
I get a segv in building stage2 on alpha building collect.c.
The problem is that while allocate_reg_info sizes the array with
some slop, we don't properly initialize any of the elements in
the slop zone, so when we go to access them later (as in jump.c
circa line 1070), we lose.
r~
Index: regclass.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/regclass.c,v
retrieving revision 1.25
diff -c -p -d -r1.25 regclass.c
*** regclass.c 1998/07/02 13:49:34 1.25
--- regclass.c 1998/07/05 08:05:20
*************** allocate_reg_info (num_regs, new_p, renu
*** 1866,1874 ****
size_t max_index = reg_data->max_index;
reg_next = reg_data->next;
! if (min_index <= num_regs)
{
! size_t max = (max_index > num_regs) ? num_regs : max_index;
if (!reg_data->used_p) /* page just allocated with calloc */
reg_data->used_p = 1; /* no need to zero */
else
--- 1866,1876 ----
size_t max_index = reg_data->max_index;
reg_next = reg_data->next;
! if (min_index <= regno_allocated)
{
! size_t max = max_index;
! if (max > regno_allocated)
! max = regno_allocated;
if (!reg_data->used_p) /* page just allocated with calloc */
reg_data->used_p = 1; /* no need to zero */
else