This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
why "only" -O optimization for building gcc?
- To: GCC Mailing List <gcc at gcc dot gnu dot org>
- Subject: why "only" -O optimization for building gcc?
- From: Jonathan Thornburg <jthorn at galileo dot thp dot univie dot ac dot at>
- Date: Fri, 19 Nov 1999 18:25:59 +0100
- Cc: Jonathan Thornburg <jthorn at galileo dot thp dot univie dot ac dot at>
The gcc build instructions install/build.html say (in 2.95.2)
> <p>If you want to save additional space during the bootstrap and in
> the final installation as well, you can build the compiler binaries
> without debugging information with "make CFLAGS='-O' LIBCFLAGS='-g
> -O2' LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap". This will save
> roughly 40% of disk space both for the bootstrap and the final
Is there some deep reason why the instructions don't suggest using
higher optimization for compiling gcc itself (and also the library), eg
make CFLAGS='-O9' LIBCFLAGS='-g -O9' \
LIBCXXFLAGS='-g -O9 -fno-implicit-templates' \
bootstrap
This obviously makes for a slower and more memory-intensive build, but
I'd expect it to yield a faster and maybe smaller gcc binary. Is there
a hidden gotcha here?
If not, perhaps the build instructions should say something about higher
optimization levels?
--
-- Jonathan Thornburg <jthorn@galileo.thp.univie.ac.at>
http://www.thp.univie.ac.at/~jthorn/home.html
Universitaet Wien (Vienna, Austria) / Institut fuer Theoretische Physik
"Stocks are now at what looks like a permanent high plateau" -- noted
economist Irving Fisher, 2 weeks before the 1929 stock market crash