[PATCH ggc] fix ggc_alloc_rtvec_resized
Current implementation of ggc_alloc_rtvec_resized allocates more spaces for rtvec. This patch uses original formula to compute size for rtvec. Bootstrap on x86_64 successfully. OK for trunk? By the way, I don't have write access to SVN repository yet. Could you please help commit it after approval? Liang. 2011-08-16 Liang Wang * ggc.h (ggc_alloc_rtvec_sized): Change arguments of ggc_alloc_zone_vec_rtvec_def. diff --git a/gcc/ggc.h b/gcc/ggc.h index 7f2144c..07f0dda 100644 --- a/gcc/ggc.h +++ b/gcc/ggc.h @@ -266,8 +266,9 @@ extern struct alloc_zone tree_zone; extern struct alloc_zone tree_id_zone; #define ggc_alloc_rtvec_sized(NELT) \ -(ggc_alloc_zone_vec_rtvec_def (sizeof (rtx),\ - sizeof (struct rtvec_def) + ((NELT) - 1), \ +(ggc_alloc_zone_vec_rtvec_def (1, \ + sizeof (struct rtvec_def)\ + + ((NELT) - 1) * sizeof (rtx), \ &rtl_zone)) #if defined (GGC_ZONE) && !defined (GENERATOR_FILE) changelog Description: Binary data ggc.patch Description: Binary data
[PATCH] fix misleading description in vec.h
Hi, I find that the description from line 36, gcc/vec.h is wrong. It should be the pointers in structure object variant are dereferenced and the objects copied into the vector. The following patch makes the *former* and *latter* in comment to point to the right thing. OK for trunk? By the way, I don't have write access to SVN repository yet. Could you please help commit it after approval? Thanks, Liang. 2011-09-27 Liang Wang * gcc/vec.h: Fix comment. diff --git a/gcc/vec.h b/gcc/vec.h index 789e8e2..46d9da4 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see Because of the different behavior of structure objects, scalar objects and of pointers, there are three flavors, one for each of - these variants. Both the structure object and pointer variants + these variants. Both the pointer and structure object variants pass pointers to objects around -- in the former case the pointers are stored into the vector and in the latter case the pointers are dereferenced and the objects copied into the vector. The scalar
Re: [PATCH] fix misleading description in vec.h
On Tue, Sep 27, 2011 at 9:27 AM, Liang Wang wrote: > Hi, > > I find that the description from line 36, gcc/vec.h is wrong. It > should be the pointers in structure object variant are dereferenced > and the objects copied into the vector. > > The following patch makes the *former* and *latter* in comment to > point to the right thing. > > OK for trunk? > > By the way, I don't have write access to SVN repository yet. Could > you please help commit it after approval? > > Thanks, > Liang. > > 2011-09-27 Liang Wang > > * gcc/vec.h: Fix comment. > > > diff --git a/gcc/vec.h b/gcc/vec.h > index 789e8e2..46d9da4 100644 > --- a/gcc/vec.h > +++ b/gcc/vec.h > @@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see > > Because of the different behavior of structure objects, scalar > objects and of pointers, there are three flavors, one for each of > - these variants. Both the structure object and pointer variants > + these variants. Both the pointer and structure object variants > pass pointers to objects around -- in the former case the pointers > are stored into the vector and in the latter case the pointers are > dereferenced and the objects copied into the vector. The scalar > Sorry. I forget to attach files. changelog Description: Binary data diff --git a/gcc/vec.h b/gcc/vec.h index 789e8e2..46d9da4 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see Because of the different behavior of structure objects, scalar objects and of pointers, there are three flavors, one for each of - these variants. Both the structure object and pointer variants + these variants. Both the pointer and structure object variants pass pointers to objects around -- in the former case the pointers are stored into the vector and in the latter case the pointers are dereferenced and the objects copied into the vector. The scalar