This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
more rtvec fixes
- To: gcc-patches at gcc dot gnu dot org
- Subject: more rtvec fixes
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Sun, 03 Oct 1999 18:06:13 -0600
- Reply-To: law at cygnus dot com
The garbage collection code assumed that an rtvec was an array of rtunions
instead of an array of rtxs. This was causing a variety of unpleasant
problems.
* ggc-none.c (ggc_alloc_rtvec): An rtvec is an array of rtx,
not an array of rtunion.
* ggc-page.c (ggc_alloc_rtvec): Similarly.
* ggc-simple (ggc_free_rtvec): Similarly.
Index: ggc-none.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ggc-none.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 ggc-none.c
*** ggc-none.c 1999/09/11 19:50:42 1.4
--- ggc-none.c 1999/10/04 06:12:31
*************** rtvec
*** 51,57 ****
ggc_alloc_rtvec (nelt)
int nelt;
{
! int size = sizeof (struct rtvec_def) + (nelt - 1) * sizeof (rtunion);
rtvec v;
v = (rtvec) xmalloc (size);
--- 51,57 ----
ggc_alloc_rtvec (nelt)
int nelt;
{
! int size = sizeof (struct rtvec_def) + (nelt - 1) * sizeof (rtx);
rtvec v;
v = (rtvec) xmalloc (size);
Index: ggc-page.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ggc-page.c,v
retrieving revision 1.3
diff -c -3 -p -r1.3 ggc-page.c
*** ggc-page.c 1999/09/29 23:08:11 1.3
--- ggc-page.c 1999/10/04 06:12:32
*************** ggc_alloc_rtvec (nelt)
*** 795,801 ****
int nelt;
{
return (struct rtvec_def *)
! alloc_obj (sizeof (struct rtvec_def) + (nelt - 1) * sizeof (rtunion), 1);
}
--- 795,801 ----
int nelt;
{
return (struct rtvec_def *)
! alloc_obj (sizeof (struct rtvec_def) + (nelt - 1) * sizeof (rtx), 1);
}
Index: ggc-simple.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/ggc-simple.c,v
retrieving revision 1.19
diff -c -3 -p -r1.19 ggc-simple.c
*** ggc-simple.c 1999/09/22 05:51:43 1.19
--- ggc-simple.c 1999/10/04 06:12:33
*************** ggc_free_rtvec (v)
*** 366,372 ****
#endif
#ifdef GGC_POISON
memset (v, 0xBB, sizeof (*v) + ((GET_NUM_ELEM (&v->vec) - 1)
! * sizeof (rtunion)));
#endif
free (v);
--- 366,372 ----
#endif
#ifdef GGC_POISON
memset (v, 0xBB, sizeof (*v) + ((GET_NUM_ELEM (&v->vec) - 1)
! * sizeof (rtx)));
#endif
free (v);