[Bug c++/80290] [6/7 Regression] g++ uses unreasonable amount of memory compiling nested string maps

rguenther at suse dot de gcc-bugzilla@gcc.gnu.org
Wed Apr 19 08:06:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80290

--- Comment #16 from rguenther at suse dot de <rguenther at suse dot de> ---
On April 19, 2017 8:10:58 AM GMT+02:00, "jason at gcc dot gnu.org"
<gcc-bugzilla@gcc.gnu.org> wrote:
>https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80290
>
>--- Comment #15 from Jason Merrill <jason at gcc dot gnu.org> ---
>Adding a timevar to cxx_eval_outermost_constant_expr shows minimal time
>spent
>in constexpr evaluation; it also doesn't show up in -fmem-report.  So
>constexpr
>isn't the problem.

The number of calls suggest otherwise.  Are you sure the timevar isn't pushed
away here (overload resolution seemed to be triggered by constexpr evaluation,
so better constrxpr caching should help)

>It seems to me that the problem is that we added a bunch of constructor
>template overloads, and made all of them rely on doing further overload
>resolution in order to evaluate the SFINAE condition, and that's a lot
>more
>work for the compiler.  And then there are a few places, notably
>push_tinst_level, that allocate memory that isn't freed until the next
>GC, so
>in this case it keeps building up.

I suppose adding GC points isn't easily possible either?

>We ought to be able to be smarter about caching previous overload
>resolution
>results, but that would be new machinery that doesn't seem suitable for
>stage
>4.
>
>I'll keep poking.


More information about the Gcc-bugs mailing list