memory explosion in 1.1 pre-release caused by GCSE

Jeffrey A Law
Thu Oct 15 01:44:00 GMT 1998

  In message <>you write:
  > Hi,
  > i don't know if this is a bug or not but it may be of interest to some
  > of you.  I have a fairly small function (see below) which needs 350 MB
  > to compile.  It makes a heavy usage of templates, but this particular
  > problem is caused by GCSE as demonstrated by the following tests :
  >   compiler			needed memory 
  > g++ 2.8.1 -O2			 94 MB
  > egcs 1.0.2 -O2			 95 MB
  > egcs 1.1 -O2			317 MB
  > egcs 1.1 -O2 -fno-gcse		 99 MB
  > Memory usage of more than 800 MB have been reported on this list for
  > template-based program (with blitz).  This program uses a similar
  > library (CGAL), but the problem seems different as it can be compiled
  > with -O2 -fno-gcse.  So what do you think ?  Is it a bug ?
  > This is on sparc-sun-solaris2.5.1 and the same thing happens on
  > i686-pc-linux-gnu but the machine does not have enough memory.  The
  > preprocessed (cleaned-up and renamed) file can be found here :
  > (85 KB)
Thanks.  I don't think this is a bug.

The function in question is, err, huge.

It has on the order of 44k pseudo registers, 211k insns and 10k basic blocks.

Consider that just *one* of the bitmap vectors needed to hold register info
needed to perform global optimizations will be about 50meg.
(44k regs -> ~5500bytes for each bitmap * 10k bitmaps).

On top of that we also need several other tables that will be comparable in
size, so 200+meg for global optimiations on that testcase isn't unreasonable.


More information about the Gcc-bugs mailing list