This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Release RTL bodies after compilation (sometimes)


On Wed, 2004-09-15 at 12:54, Mike Stump wrote:
> On Sep 14, 2004, at 7:47 PM, David Edelsohn wrote:
> > ggc_free() is wrong and I strongly disagree with using it as a
> > fundamental concept in the design and implementation of GCC.
> 
> It is amazing to me that people hate it so much.  To me, it provides 
> flexibility.  The flexibility to make a compiler that reduces memory 
> pressure on a system.  The flexibility to reduce cache pressure on a 
> system.  The flexibility to make a faster compiler.
It's a bloody band-aid.  In the end I think our time is going to
be better spent looking at alternate ways to represent the data we
need.

ggc_free's only purpose in life was supposed to be to give an object
back to the GC system so that it could be re-used before the next
GC cycle.  The number of cases where it's appropriate given our 
rats nest of pointers is small.  Again, as someone who pushed 
reasonably hard to get ggc_free into GCC a while back, I've come
to realize that it was a strategic mistake and takes us down a
path which leads to a compiler which is significantly more difficult
to maintain.



> If performance isn't an issue, then we should remove ggc_free.  It it 
> is, we should keep it, at least until such time as another technology 
> is proven to replace the need for it.
Using ggc_free is IMHO ultimately asking for a semi-random segfault
because of the difficulty involved in ensuring that no references
to the ggc_free'd data remain.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]