This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimizing g++ 3.2
- From: Joe Buck <Joe dot Buck at synopsys dot com>
- To: rguenth at tat dot physik dot uni-tuebingen dot de (Richard Guenther)
- Cc: gcc at gcc dot gnu dot org
- Date: Wed, 31 Jul 2002 09:54:13 -0700 (PDT)
- Subject: Re: Optimizing g++ 3.2
> How can I build an optimized g++ compiler, preferrably using profiling
> feedback from heavily templated code? What are suggested options for
> compiling gcc, if optimizing for speed? Will -fprefetch-loop-arrays help
> (Athlon TB)? What are experiences?
I haven't seen much on this. I should warn, though, that if you do *any*
experiments of this kind there is a risk that the compiler you produce
will not be reliable (general rule of programming: if it has never been
tested, it probably does not work). So, before you use your profiled
compiler built with a long list of specialized options, be sure that you
run the regression suite first and get the same results as you get with
a normal "make bootstrap-lean". Otherwise you might just produce garbage
very quickly.
> What are suggested g++ options to speed up compilations of heavily
> templated code during development?
I'll let others give suggestions, but ...
Even on a single-processor machine, "make -j2" will give substantial
speedup, since one process can have the CPU while the other is doing disk
I/O, and C++ tends to need lots of disk I/O because of the large headers.
This assumes that you have enough RAM, of course.