Can gcc 4.3.1 handle big function definitions?

2008-09-08 Thread Klaus Grue

Hi All,

Is this a known problem:

After upgrading to gcc 4.3.1, I can no longer compile a function whose 
source code is 0.7 Megabyte before preprocessing and 3.5 Megabyte after 
preprocessing.


The function (named "testsuite") is just a long list of statements
essentially of form if(!condition){complain();exit();}

The behaviour is: CPU time goes to 100%, then RAM size grows to
1 Gigabyte, then swap space starts growing and CPU time goes to 10%.

On my previous gcc (4.2.something, I think), compilation went fine.

Best,
Klaus

---

[EMAIL PROTECTED]:~> gcc -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --with-local-prefix=/usr/local 
--infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 
--libexecdir=/usr/lib64 
--enable-languages=c,c++,objc,fortran,obj-c++,java,ada 
--enable-checking=release --with-gxx-include-dir=/usr/include/c++/4.3 
--enable-ssp --disable-libssp --with-bugurl=http://bugs.opensuse.org/ 
--with-pkgversion='SUSE Linux' --disable-libgcj --with-slibdir=/lib64 
--with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new 
--disable-libstdcxx-pch --program-suffix=-4.3 
--enable-version-specific-runtime-libs --enable-linux-futex 
--without-system-libunwind --with-cpu=generic --build=x86_64-suse-linux

Thread model: posix
gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] 
(SUSE Linux)




Re: Can gcc 4.3.1 handle big function definitions?

2008-09-08 Thread Klaus Grue

On Mon, 8 Sep 2008, Andrew Haley wrote:


Klaus Grue wrote:


Is this a known problem:

After upgrading to gcc 4.3.1, I can no longer compile a function whose
source code is 0.7 Megabyte before preprocessing and 3.5 Megabyte after
preprocessing.

The function (named "testsuite") is just a long list of statements
essentially of form if(!condition){complain();exit();}

The behaviour is: CPU time goes to 100%, then RAM size grows to
1 Gigabyte, then swap space starts growing and CPU time goes to 10%.

On my previous gcc (4.2.something, I think), compilation went fine.


Isn't this simply that you need more RAM?  Sure, as gcc grows and we
add more optimizations, you need more memory, but there's no
explicit limitation.  Is this with -O0?  If so, I think that's a
bug.


Thanks for the reply.

I compiled without -Ox.

To double check, I tried with -O0 which gave the same result as not using 
-Ox.


By the way, the source text is a http://logiweb.eu/grue/lgwam.c
and is compiled with gcc -ldl -o lgwam lgwam.c

-Klaus