This is the mail archive of the gcc@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]

Re: template instantiation problems !? [was: egcs-g++-97112: virtual memory exhausted]



> From jason@cygnus.com Wed Nov 26 20:27 MET 1997
> 
> >>>>> Max Lawson <mlawson@drfmc.ceng.cea.fr> writes:
> 
> >  	I've seen on the egcs-bugs list that someone else has 
> > reported a similar misbehaviour of cc1plus (November_1997::
> > "Memory leak with -O -Wall" by P.Schmid) on a i386-glibc1. 
> 
> > In an earlier version of egcs, memory was not released during 
> > during the instatiation of templates and someone provided 
> > a patch against. This bug back may be in the current release !?
> 
> -pedantic -and -Wreturn-type cause the bug to resurface.  They should be
> avoided for large code until this can be fixed.
> 
> Jason
> 
	I'm sorry, but I'm not using -pedantic nor -Wreturn-type options. I'm 
only saying that the current release behaviour on my linux-box makes me think 
of a similar boggus behaviour in a previous release. Don't forget: I dunnot 
know anithing about compiler :-(. And maybe my guess is 99.99% wrong..

The compilation of the "test" program I sent use up to 80% of memory when 
setting the optimization flag to -O2 (and the system runs out of memory 
with -O6). Here is the compiler output with the verbose switch on:

Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.18/specs
gcc version egcs-2.90.18 971122 (gcc2-970802 experimental)
 /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.18/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=90 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEPTIONS -D__OPTIMIZE__ -Di386 -Di586 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386__ -D__i586__ -Asystem(unix) -Acpu(i386) -Amachine(i386) test.cc /tmp/cca11101.ii
GNU CPP version egcs-2.90.18 971122 (gcc2-970802 experimental) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i586-pc-linux-gnulibc1/include
 /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.18/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.18/cc1plus /tmp/cca11101.ii -quiet -dumpbase test.cc -O2 -version -o /tmp/cca11101.s
GNU C++ version egcs-2.90.18 971122 (gcc2-970802 experimental) (i586-pc-linux-gnulibc1) compiled by GNU C version egcs-2.90.18 971122 (gcc2-970802 experimental).
 as -V -Qy -o /tmp/cca111011.o /tmp/cca11101.s
GNU assembler version 970731 (i586-linux), using BFD version linux-2.8.1.0.15
 /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.18/ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.18/crtbegin.o -L/usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.18 -L/usr/local/i586-pc-linux-gnulibc1/lib -L/usr/local/lib /tmp/cca111011.o -lstdc++ -lm -lgcc -lc -lgcc /usr/local/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.18/crtend.o /usr/lib/crtn.o


Regards, Max


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