This is the mail archive of the
mailing list for the GCC project.
Re: [C++ patch] PR c++/12850
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 12 Jan 2004 14:49:23 -0800
- Subject: Re: [C++ patch] PR c++/12850
- Organization: CodeSourcery, LLC
- References: <20040110170608.GO1964@kam.mff.cuni.cz>
On Sat, 2004-01-10 at 09:06, Jan Hubicka wrote:
> 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
> 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 <email@example.com>