Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: other gcc problemy
       [not found] <199605142057.NAA05396@web.azstarnet.com>
@ 1996-05-14 19:12 ` Matti E Aarnio
  1996-05-14 21:36 ` other gcc problem Harald Koenig
  1 sibling, 0 replies; 3+ messages in thread
From: Matti E Aarnio @ 1996-05-14 19:12 UTC (permalink / raw)


> Does that file have a large initialized array, by any chance?
> I noticed that initialized arrays seem to take O(N^2) memory.
> An initialized array of several thousand entries is gonna blow
> away 32MBs of memory just like nothing with gcc (that's one reason
> MILO generates an assembly file instead).  I think that has been a
> problem ever since c++ support was added.

	I doubt.  Had it been that, it would have created same
	behavior also at i386 compiler.

	I recall the array-initializer problem was fixed by 2.6.0.

> 	--david
> --
> To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

	/Matti Aarnio <mea@utu.fi>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: other gcc problem
       [not found] <199605142057.NAA05396@web.azstarnet.com>
  1996-05-14 19:12 ` other gcc problemy Matti E Aarnio
@ 1996-05-14 21:36 ` Harald Koenig
  1 sibling, 0 replies; 3+ messages in thread
From: Harald Koenig @ 1996-05-14 21:36 UTC (permalink / raw)


> Does that file have a large initialized array, by any chance?
> I noticed that initialized arrays seem to take O(N^2) memory.

no.  does this initialisation depend of the optimisation level ?

> An initialized array of several thousand entries is gonna blow
> away 32MBs of memory just like nothing with gcc (that's one reason
> MILO generates an assembly file instead).  I think that has been a
> problem ever since c++ support was added.

cc1 only takes ~4.5MB memory and just sucks CPU time for 10+ minutes
with -O -01 -O2 etc. (but not -O0).

I've stripped down the source file and located the function which takes
all the CPU time; below it is.  this is extracted and a bit normalized
from the original source file.  if you define ONLY_2_SECONDS compilation
with -O1 or -O2 will need ~2 seconds, every additional line will increase
the CPU time needed dramatically...

Harald

-------------------------------------------------------------------------------
long func(long mask[2])
{
  long needbytes=0;

  if (mask[(( 0)/32)] & (((unsigned long)1) << (( 0) % 32))) needbytes += (4) ;
  if (mask[(( 1)/32)] & (((unsigned long)1) << (( 1) % 32))) needbytes += (4) ;
  if (mask[(( 2)/32)] & (((unsigned long)1) << (( 2) % 32))) needbytes += (4) ;
  if (mask[(( 3)/32)] & (((unsigned long)1) << (( 3) % 32))) needbytes += (4) ;
  if (mask[(( 4)/32)] & (((unsigned long)1) << (( 4) % 32))) needbytes += (4) ;
  if (mask[(( 5)/32)] & (((unsigned long)1) << (( 5) % 32))) needbytes += (4) ;
  if (mask[(( 6)/32)] & (((unsigned long)1) << (( 6) % 32))) needbytes += (24) ;
  if (mask[(( 7)/32)] & (((unsigned long)1) << (( 7) % 32))) needbytes += (24) ;
  if (mask[(( 8)/32)] & (((unsigned long)1) << (( 8) % 32))) needbytes += (20) ;
  if (mask[(( 9)/32)] & (((unsigned long)1) << (( 9) % 32))) needbytes += (20) ;
  if (mask[((10)/32)] & (((unsigned long)1) << ((10) % 32))) needbytes += (4) ;
  if (mask[((11)/32)] & (((unsigned long)1) << ((11) % 32))) needbytes += (4) ;
  if (mask[((12)/32)] & (((unsigned long)1) << ((12) % 32))) needbytes += (4) ;
  if (mask[((13)/32)] & (((unsigned long)1) << ((13) % 32))) needbytes += (4) ;
  if (mask[((14)/32)] & (((unsigned long)1) << ((14) % 32))) needbytes += (4) ;
  if (mask[((15)/32)] & (((unsigned long)1) << ((15) % 32))) needbytes += (4) ;
  if (mask[((16)/32)] & (((unsigned long)1) << ((16) % 32))) needbytes += (4) ;
#ifndef ONLY_2_SECONDS
  if (mask[((17)/32)] & (((unsigned long)1) << ((17) % 32))) needbytes += (4) ;
  if (mask[((18)/32)] & (((unsigned long)1) << ((18) % 32))) needbytes += (4) ;
  if (mask[((19)/32)] & (((unsigned long)1) << ((19) % 32))) needbytes += (4) ;
  if (mask[((20)/32)] & (((unsigned long)1) << ((20) % 32))) needbytes += (4) ;
  if (mask[((21)/32)] & (((unsigned long)1) << ((21) % 32))) needbytes += (4) ;
  if (mask[((22)/32)] & (((unsigned long)1) << ((22) % 32))) needbytes += (4) ;
  if (mask[((23)/32)] & (((unsigned long)1) << ((23) % 32))) needbytes += (4) ;
  if (mask[((24)/32)] & (((unsigned long)1) << ((24) % 32))) needbytes += (4) ;
  if (mask[((25)/32)] & (((unsigned long)1) << ((25) % 32))) needbytes += (4) ;
  if (mask[((26)/32)] & (((unsigned long)1) << ((26) % 32))) needbytes += (4) ;
  if (mask[((27)/32)] & (((unsigned long)1) << ((27) % 32))) needbytes += (4) ;
  if (mask[((28)/32)] & (((unsigned long)1) << ((28) % 32))) needbytes += (4) ;
  if (mask[((29)/32)] & (((unsigned long)1) << ((29) % 32))) needbytes += (4) ;
  if (mask[((30)/32)] & (((unsigned long)1) << ((30) % 32))) needbytes += (4) ;
  if (mask[((31)/32)] & (((unsigned long)1) << ((31) % 32))) needbytes += (4) ;
  if (mask[((33)/32)] & (((unsigned long)1) << ((33) % 32))) needbytes += (4) ;
  if (mask[((32)/32)] & (((unsigned long)1) << ((32) % 32))) needbytes += (4) ;
#endif

  return needbytes;
}
-------------------------------------------------------------------------------

-- 
All SCSI disks will from now on                     ___       _____
be required to send an email notice                0--,|    /OOOOOOO\
24 hours prior to complete hardware failure!      <_/  /  /OOOOOOOOOOO\
                                                    \  \/OOOOOOOOOOOOOOO\
                                                      \ OOOOOOOOOOOOOOOOO|//
Harald Koenig,                                         \/\/\/\/\/\/\/\/\/
Inst.f.Theoret.Astrophysik                              //  /     \\  \
koenig@tat.physik.uni-tuebingen.de                     ^^^^^       ^^^^^

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: other gcc problemy
@ 1996-05-14 21:58 David Mosberger
  0 siblings, 0 replies; 3+ messages in thread
From: David Mosberger @ 1996-05-14 21:58 UTC (permalink / raw)


> > Does that file have a large initialized array, by any chance?
 > > I noticed that initialized arrays seem to take O(N^2) memory.
 > > An initialized array of several thousand entries is gonna blow
 > > away 32MBs of memory just like nothing with gcc (that's one reason
 > > MILO generates an assembly file instead).  I think that has been a
 > > problem ever since c++ support was added.

 >  > I doubt.  Had it been that, it would have created same
 >  > behavior also at i386 compiler.

 >  > I recall the array-initializer problem was fixed by 2.6.0.

No, it's still there in 2.7.x.  At least on the Alpha, but I seem to
recall seeing the same thing on an x86 with 2.7.x (I could be
misremembering in the latter case, though).

	--david

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1996-05-14 21:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <199605142057.NAA05396@web.azstarnet.com>
1996-05-14 19:12 ` other gcc problemy Matti E Aarnio
1996-05-14 21:36 ` other gcc problem Harald Koenig
1996-05-14 21:58 other gcc problemy David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox