This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Extremely long compile times
- From: John Carter <john dot carter at tait dot co dot nz>
- To: Charles <qe at dabney dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 21 Oct 2002 09:13:01 +1300 (NZDT)
- Subject: Re: Extremely long compile times
On Fri, 18 Oct 2002, Charles wrote:
> I've tried this with both gcc 3.1.1 and gcc 3.2. This particular program
> takes over 2 hours to compile.
Generally it helps to use the -pipe option. This stop it from using
temporary disk files and just pipes it from preprocessor to compiler to
assembler.
Optimization these days seems to be very cunning and take a _lot_ of time.
During development add the -O0 flag. Compiles a lot faster and easier to
debug.
Experiment with the -f optimization flags. Perhaps there is just one
optimization that is really chewing up the time.
> According to -time, 100% of the time is
> spent in "cfg cleanup". The program is generated by a language converter
> we are working on and contains only a "main" function with a very large
> number of local variables and initializing of arrays one element at a time.
It could be that gcc is doing a linear search somewhere under the
expectation that there aren't a huge number of local variables. Can you
try break it up into smaller compilation units?
> Does anyone know what could be causing this and/or what we could look for
> to correct it?
Try pull the sources for gcc out and compile them with profiling on (-pg)
and then see if there are any hot spots.
--
John Carter Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : john.carter@tait.co.nz
New Zealand
Good Ideas:
Ruby - http://www.ruby-lang-org - The best of perl,python,scheme without the pain.
Valgrind - http://developer.kde.org/~sewardj/ - memory debugger for x86-GNU/Linux
Free your books - http://www.bookcrossing.com