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: [gc-improv] Move tree-ssa-strucalias.c:heapvar_for_stmt to obstack


Thanks for pointing this out.

Gengtype did not output typed allocators for struct heapvar_map, which
usually is a sign that GGC knows nothing about the type and collects
all its objects upon next ggc_collect. After your email, I confirmed
with a debugger that struct heapvar_map objects are indeed live
throughout compilation.

Then I found the root cause:
static GTY ((if_marked ("tree_map_marked_p"), param_is (struct tree_map)))
htab_t heapvar_for_stmt;

is lying to gengtype about its parameter type (heapvar_map not
tree_map). After changing this, gengtype produced the needed typed
allocator and that's the patch I am testing now.

Does anybody know reason why the GTY annotation for heapvar_for_stmt
had tree_map as a param_is argument in the first place?

(Damn, I really should familiarize myself with parts of the compiler
outside GGC/GTY)

2009/11/1 Richard Guenther <richard.guenther@gmail.com>:
> On Sun, Nov 1, 2009 at 8:06 AM, Laurynas Biveinis
> <laurynas.biveinis@gmail.com> wrote:
>> One less GGC_NEW.
>>
>> Bootstrapped and regtested under x86_64-unknown-linux-gnu, commited to
>> gc-improv.
>
> I don't think this patch is safe. ÂThis is a mapping from tree to heapvar,
> so if tree is GCed and then re-used we get bogus lookups here. ÂNote
> this mapping is live throughout the whole compilation!
>
> Richard.
>
>> 2009-11-01 ÂLaurynas Biveinis Â<laurynas.biveinis@gmail.com>
>>
>> Â Â Â Â* tree-ssa-structalias.c (heapvar_for_stmt): Remove GTY marker.
>> Â Â Â Â(heapvar_map_obstack): New variable.
>> Â Â Â Â(struct heapvar_map): Remove GTY marker.
>> Â Â Â Â(heapvar_insert): Use obstack allocation.
>> Â Â Â Â(get_constraint_for_1): Remove duplicated prototype.
>> Â Â Â Â(heapvar_htab_alloc): New function.
>> Â Â Â Â(init_alias_heapvars): Initialize heapvar_map_obstack. ÂUse it for
>> Â Â Â Âheapvar_for_stmt element allocation.
>> Â Â Â Â(delete_alias_heapvars): Free heapvar_map_obstack.
>> Â Â Â Â(gt-tree-ssa-structalias.h): Remove include.
>> Â Â Â Â* Makefile.in (tree-ssa-structalias.o): Remove
>> Â Â Â Âgt-tree-ssa-structalias.h dependency.
>> Â Â Â Â(GTFILES): Remove gt-tree-ssa-structalias.h
>>
>> --
>> Laurynas
>>
>



-- 
Laurynas


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