This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13216] New: compiler comsuming too much memory and time when there are too many inline functions
- From: "xecutor at sendmail dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Nov 2003 13:23:02 -0000
- Subject: [Bug c++/13216] New: compiler comsuming too much memory and time when there are too many inline functions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Try to compile code generated by this perl script:
#!/usr/bin/perl
print '#include <stdio.h>'."\n";
print '#include <string>'."\n";
print 'using namespace std;'."\n";
print "template <class T> inline T func$_(const T& a,const T& b){return a+b;}
\n"for(1..100);
print "string foo(const string& x,const string& y){return\n";
print "func$_(x,func$_(x,y))+\n"for(1..100);
print "x+y;}\n";
print 'int main(int argc,char* argv[]){printf("%s\n",foo(argv[1],argv[2]).c_str
());return 0;}'."\n";
with this options:
g++ -O3 -finline-limit=16384
after 30 minutes of compilation on P4-2000 with 1Gb of memory and 2Gb of swap,
it takes 1Gb of memory and still running.
On real big project with a lot of inline template functions after 40 minutes of
compilation it consumed all the avialable memory and finally crashed.
--
Summary: compiler comsuming too much memory and time when there
are too many inline functions
Product: gcc
Version: 3.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: xecutor at sendmail dot ru
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: SunOS smsc 5.9 Generic_112234-06 i86pc i386 i86pc
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13216