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: [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.

> 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?


-- 
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC


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