This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16273] Virtual memory exhausted in C++ even w/out any optimization
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Jun 2004 13:48:27 -0000
- Subject: [Bug c++/16273] Virtual memory exhausted in C++ even w/out any optimization
- References: <20040629153633.16273.olivier.fourdan@regis-dgac.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-06-30 13:48 -------
Created an attachment (id=6664)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6664&action=view)
Smaller example
After some reduction I came up with the attached example.
And now I'm convinced that this is really just a memory-hog.
Just have a look at the memory usage and compilation times:
gcc 2.95.3: 15MB 2.87s
gcc 3.0: segfault
gcc 3.0.4: ICE in build_secondary_vtable, at cp/class.c
gcc 3.1: 82MB 11.17s
gcc 3.2.3: 82MB 11.22s
gcc 3.3: 334MB 72.07s
gcc 3.3.4: 334MB 70.58s
gcc 3.4.0: 554MB 10.52s
3.4 branch: 554MB 10.52s
head: 654MB 10.16s
lno branch: 655MB 10.45s
This is an increase in memory usage by a factor of 44 sinc gcc 2.95.3 !!!!
It's no surprise that this goes beyond 2GB with a larger example. :-(
Adding "-fsyntax-only" on the command-line doesn't help.
Btw, the reduced example is all about nested classes, inheritance and
virtual functions. It compiles without errors since gcc 2.95.3 (with
the exception that the 3.0 branch crashes). I got rid of all static
member funtions and most (if not all) function definitions (as opposed
to declarations).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16273