This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Compiler uses a lot of memory for large initialized arrays
- From: Steven Bosscher <stevenb at suse dot de>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Ian Lance Taylor <ian at wasabisystems dot com>, mark at codesourcery dot com,gcc at gcc dot gnu dot org
- Date: Thu, 2 Dec 2004 18:05:17 +0100 (CET)
- Subject: Re: Compiler uses a lot of memory for large initialized arrays
- Organization: SuSE Linux AG
- References: <m3wtw0u1i7.fsf@gossamer.airs.com> <Pine.LNX.4.61.0412021631560.26457@digraph.polyomino.org.uk>
On Dec 02, 2004 05:34 PM, Joseph S. Myers <joseph@codesourcery.com> wrote:
> On Thu, 2 Dec 2004, Ian Lance Taylor wrote:
>
> > This test case works fine with 2.95.3. Looking into the patches I
> > came across this note from you from four years ago:
> > http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00937.html
>
> And hopefully you came across the November part of the thread as well: C99
> designated initializers allow
>
> int i[10000000] = { 0, 1, 2, 3, 4, 5, /* ... */
> 9999998, 9999999, [0] = -1 };
>
> which stops optimizing in the simplest way by writing out initializers to
> the assembler output before the whole initializer has been parsed.
Ouch.
Do we disable this if -std!=c99?
Gr.
Steven