This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- From: Richard Guenther <rguenther at suse dot de>
- To: Daniel Jacobowitz <drow at false dot org>
- Cc: Michael Matz <matz at suse dot de>, Jason Merrill <jason at redhat dot com>, Gabriel Dos Reis <gdr at cs dot tamu dot edu>, Nathan Sidwell <nathan at codesourcery dot com>, Mark Mitchell <mark at codesourcery dot com>, Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org, mrs at apple dot com, Paolo Carlini <pcarlini at suse dot de>
- Date: Tue, 12 Dec 2006 16:16:07 +0100 (CET)
- Subject: Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- References: <457D726E.7060905@redhat.com> <Pine.LNX.4.64.0612111628100.3105@zhemvz.fhfr.qr> <Pine.GSO.4.58.0612110926270.19022@sun> <Pine.LNX.4.64.0612111635030.3105@zhemvz.fhfr.qr> <457D7AB1.10706@redhat.com> <Pine.LNX.4.64.0612111647520.3105@zhemvz.fhfr.qr> <20061211155733.GA2660@nevyn.them.org> <Pine.LNX.4.64.0612111658590.29962@wotan.suse.de> <20061211174548.GA7094@nevyn.them.org> <Pine.LNX.4.64.0612121519200.29962@wotan.suse.de> <20061212150652.GA18750@nevyn.them.org>
On Tue, 12 Dec 2006, Daniel Jacobowitz wrote:
> On Tue, Dec 12, 2006 at 03:36:32PM +0100, Michael Matz wrote:
> > Meanwhile it seems people downthread came to a preferred solution (listing
> > template args explicitely). I'm not sure how sensible that is given
> > testcases like in PR29433 (the debug info will still be HUGE and basically
> > useless) but we probably don't gain that capability immediately. So, do
> > people really think that until then we should continue to output multi-MB
> > strings which no sane person is interested to look at in a debugger anyway
> > just for sake of a weakly defined specification until we gain that
> > possibility?
>
> What else do you expect to happen? You've created a type whose fully
> expanded name is 2MB, expect at least 2MB of debug info for it. I
> can't readily see what the names look like from the test case, but
> the debug info might not be too large if there's substantial
> duplication in it - DIEs will be reused.
>
> Sure, we could throttle the debug info and omit the name. But that's
> much like reintroducing a 63 character (or however many) limit on
> unique identifiers; the debug info wouldn't unambiguously identify the
> source type.
I think we might get back some compile-time memory usage by constructing
the full names at debug output time. If I remember correctly most of
the identifiers generated are for types that don't have their template
arguments fully substituted (so we won't see an instantiation of that
type or debug info). But I might be wrong, as what happens there in
the C++ frontend is not entirely clear to me.
Now, we might be able to conditionalize the patch as is on not
generating debug info - this way memory usage for the -O0 case will
drop from ~2.5GB to 350MB. With -O0 -g it will again be ~2.5GB.
Does that sound like a reasonable approach until we fix all the
debug info issues?
Thanks,
Richard.
--
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
- References:
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory
- Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory