This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

memory explosion in 1.1 pre-release caused by GCSE



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 :

  ftp://ftp.irisa.fr/local/temis/ricquebo/egcs/explo.cc.gz (85 KB)

-- 
Laurent.

int main()
{
  const int numPoints1 = 4;
  static Point points1[numPoints1] = {Point(0.4,1), Point(1,0.3),Point(0.0,-0.9),
                                      Point(-1,0)};
  Point point2(0.0,0.0);
  Point point3(-1,1);
  vector<Point> points4(3);
  points4[0] = Point(1,0.9);
  points4[1] = Point(1.4,-0.3);
  points4[2] = Point(0.6,0);
  Triangulation_2 tr;
  tr.insert(points1,points1+numPoints1);
  tr.insert(point2);
  tr.insert(point3);
  tr.insert(points4.begin(),points4.end());
  Vertex_iterator iter = tr.vertices_begin();
  while ( iter != tr.vertices_end() )
  {
    cout << (*iter).point() << endl;
    iter++;
  }
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]