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]

why "only" -O optimization for building gcc?

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' \
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 <>
   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

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