public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13216] New: compiler comsuming too much memory and time when there are too many inline functions
@ 2003-11-28 13:23 xecutor at sendmail dot ru
2003-11-28 17:20 ` [Bug c++/13216] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: xecutor at sendmail dot ru @ 2003-11-28 13:23 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/13216] compiler comsuming too much memory and time when there are too many inline functions
2003-11-28 13:23 [Bug c++/13216] New: compiler comsuming too much memory and time when there are too many inline functions xecutor at sendmail dot ru
@ 2003-11-28 17:20 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-11-28 17:20 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-11-28 17:20 -------
I can confirm this on 3.3 but on the mainline, it only uses 50M (this is on powerpc-apple-darwin).
This is fixed by unit-at-a-time.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Keywords| |memory-hog
Resolution| |FIXED
Target Milestone|--- |3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13216
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-11-28 17:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-28 13:23 [Bug c++/13216] New: compiler comsuming too much memory and time when there are too many inline functions xecutor at sendmail dot ru
2003-11-28 17:20 ` [Bug c++/13216] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).