This is the mail archive of the gcc@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: Copying collection and our ggc_collect practices


"Zack Weinberg" <zack@codesourcery.com> writes:

> Daniel Berlin <dberlin@dberlin.org> writes:
> 
> > On Wed, 17 Sep 2003, Zack Weinberg wrote:
> >> Daniel Berlin <dberlin@dberlin.org> writes:
> >> > Currently, gcc has a bad habit of keeping ggc_alloc'd pointers in unmarked
> >> > local variables, and expecting the addresses not to change over a
> >> > ggc_collect.
> >> Could you give examples?
> >
> > Sure, here's one.
> >
> > In cgraphunit.c, cgraph_expand_functions stores cgraph_node * (which are
> > ggc_alloc'd) in the order array, which is xcalloc'd and unmarked.  It calls
> > cgraph_expand_function which calls the expand_function hook which calls
> > ggc_collect.
> 
> Ok, so that's pretty easy to turn into a file-scope static as ggc
> needs.  I seriously suggest you do a sweep, find all of these, and fix
> them.

I'm inclined to agree.  This is what I did for PCH.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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