This is the mail archive of the 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]
Other format: [Raw text]

HUGE compilation time / memory requirement in compilation of single file


We've got an application consisting of roughly one million lines 
of C++ code, and it compiles and runs at least in linux (g++),
windows (MSVC++) and Solaris (Forte). We now have a weird 
situation with two of our files that i can't instantly figure out
whether to report them as a bug in g++ or not. 

Other one being relatively big file (~ 2000LOC) having one single 
class inside that is using high number of inline functions. It 
takes about 4 hours to compile this file with a 2.8GHz xeon (it's
a dual CPU system) with 4GB of RAM. This happens regardless of
whether it's just unoptimized (just -g) or optimized (-g -O2) 

Other one is somewhat similar, except that it doesn't take that
much time, but it almost runs out of 32 bit memory address space
while compiling the file. 3GB of memory wasn't enough to compile
this single file. Amount of inlined stuff in this case wasn't 
that big, but the class had huge nested switch-case structures
inside methods. Adjusting size of these switches had a direct
relation to amount of memory consumed during compilation. This
seems to happen only with optimized builds.

In both of these cases output seems valid, and program runs as
it's supposed to. Tested gcc/g++ versions are 3.3 and 3.3.1. Both
of these files compile just as you would expect them to, on any
other compiler tried (icc, MSVC++, Forte). So the question is, 
can these be regarded as 'normal' behaviour, or should i start to
build up a testcase out of them?


// Janne

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