> -----Original Message----- > From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx] On > Behalf Of Olivier Langlois > Sent: Friday, July 07, 2006 2:03 PM > To: gcc-help@xxxxxxxxxxx > Subject: GCC is freezing when compiling a big TU with the -g option > > Hi, > > I'm compiling a C++ TU that after preprocessing is 50000 lines big (most > of the lines are from header files). It compiles fine without '-g' but > when I use the -g option, the compiler freezes. I used the option '-Q' > to try to figure out where the problem was located. The compilation gets > stuck while compiling functions inside class declarations in the header > files. It does not seems to be some function in particular that is > causing the problem as if I reorder the header files inclusion, the > compiler is going to stop in a new place. > > The GCC version that I am using is 3.2 First of all, GCC 3.2 is rather old. The current released version is 4.1.1. It might be some bugs have been fixed since then. > Also, I have observed weird things such as I see destructors and > constructors being compiled like 4 times in the '-Q' output ie: > > virtual OutputFormat::~OutputFormat() > OutputFormat::~OutputFormat() > virtual OutputFormat::~OutputFormat() > virtual OutputFormat::~OutputFormat() > > Is this something normal? I think that the issue might be that the > compiler is running out of memory. I also see this in the output: I dunno, it might be due to the function being inlined in several places. > {GC 27652k -> 24958k} > > Any suggestion on what I could try to fix the problem? I would suspect you are running out of memory, and your system is paging itself to death. Many systems have monitors that can tell when you have excessive amounts of swapping going on. You might want to see if you are swapping, or the program is just executing in an endless loop. Assuming the system is swapping, the only real solutions are to wait for the compile to finish or get more memory. Unfortunately in terms of my previous thought about going to a new version of the compiler, newer versions of GCC tend to be more memory hungry, and so it might make the problem of running out of memory worse. Of course if it is a real bug, we would need a proper bug report including a file that people can compile to see what the problem is. > Thank you, > Olivier Langlois > http://www.olivierlanglois.net -- Michael Meissner AMD, MS 83-29 90 Central Street Boxborough, MA 01719