This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
You introduced a memory leak with the IPA-SSA stuff
- From: "Daniel Berlin" <dberlin at dberlin dot org>
- To: "Hubicka, Jan" <jh at suse dot cz>, GCC <gcc at gcc dot gnu dot org>
- Date: Sat, 28 Jul 2007 14:47:45 -0500
- Subject: You introduced a memory leak with the IPA-SSA stuff
It used to be that the bitmap obstack known as "alias_bitmap_obstack"
was released and renewed every time we called compute_may_aliases.
This didn't really leak because the absolute last one was destroyed at
the end of compilation.
You changed it to be only released if gimple_aliases_computed_p (cfun).
This of course, leaks all the bitmaps in that obstack whenever we
change functions, because bitmap_obstack_initialize does not free the
old obstack if it is still in use, it just leaks it.
The code needs to be something like
if (alias_bitmap_obstack.elements != NULL)
bitmap_obstack_release (&alias_bitmap_obstack);
bitmap_obstack_initialize (&alias_bitmap_obstack);
(or some other approriate thing :P)
Right now we leak a couple meg per function if they have a lot of
symbols, we'd leak more otherwise.
--Dan