This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ patch] PR c++/12850
> On Sat, 2004-01-10 at 09:06, Jan Hubicka wrote:
> > Hi,
> > The problem of C++/12850 testcase is that we create insanely many instantiations.
> > These instantiations are all created by recursive walk so we don't GGC collect
> > because function_depth gets large. I need two changes in order to get
> > GGC doing what it is supposed to do.
> >
> > First one is to deffer those instantiations to the very end of
> > compilation. We can do the garbage collection better then and we limit
> > recusion that is both good. This came in with patch
> > http://gcc.gnu.org/ml/gcc-patches/2003-04/msg01679.html
> > The patch force the recursion when there is chance that callee will be
> > proved to be nothrow. I see no point doing this when not optimizing or
> > with unit-at-a-time (where we sort the functions anyway) This assumes
> > that the toplev.c code is only one propagating the nothrow flags and
> > that C++ don't have it's own mechanizm somewhere I never heart about.
>
> I agree, and that part of the patch is OK.
Thanks!
>
> > This alone doesn't help, because all the instantiations happens with
> > function_depth == 2 thus we skip ggc_collect. instantiate_template
> > itself increase function_depth and once gain we increase it in
> > expand_or_deffer_fn, so we conclude to deffer everything and lose again.
>
> Can we just get rid of the function_depth increase in
> instantiate_template, now that it's done around expand_or_defer_fn?
I was discussiong this with Jason ans patch to try this is enqued for
testing. The problem I see (just from highlevel, didn't verified it
yet) is the fact that mark_used can recurse from static initializer
build that itself is unsafe and don't increase function depth.
Honza
>
>
> --
> Mark Mitchell <mark@codesourcery.com>
> CodeSourcery, LLC
>