Possible GCC Bug with C++ vectors

Stephan Trebs stacit@freenet.de
Thu Apr 3 14:36:00 GMT 2003


I want to report a possible gcc bug. I hope it is really a bug and not my mistake.

System  : Athlon 1333, 512 MB RAM, Linux 2.4.18 (Debian Woody)
Compiler: GCC 3.2.1 (compiled with 2.95.4 and options "-O2")
Program : C++ using <vector>

The concerning sources are attached. It is a program with 7000 lines but
no complicated stuff. Only one function and some vectors. Without flags
it compiles within eight seconds. But if I use "-O" the compiler (cc1plus)
needs slowly more and more memory and has possibly entered an invinite loop.
After 30 minutes it needs 193 MB RAM and is still working. I tried it
several times for up to 30 minutes before canceling the compiler.
GCC 2.95.4 works and needs with "-O" rather long 70 seconds to compile the

The problem seems to be in my function init(). Because a plain init(){}
works. But I couldn't find details, because this small program works:

include <cstdlib>
include <vector>

using namespace std;

main ()
  vector<vector <vector<int> > >v;

  return EXIT_SUCCESS;

And init() contains only such commands.

So I attached the big function init() as it is and gziped it.
GCC 3.0.4 seems also not to work.

I hope this description helps you.

	Stephan Trebs

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ct2.cc.gz
Type: application/x-gzip
Size: 32755 bytes
Desc: Source code
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20030403/082eaeac/attachment.bin>

More information about the Gcc-bugs mailing list