This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: why "only" -O optimization for building gcc?
- To: jthorn at galileo dot thp dot univie dot ac dot at
- Subject: Re: why "only" -O optimization for building gcc?
- From: Nick Ing-Simmons <nik at tiuk dot ti dot com>
- Date: Mon, 22 Nov 1999 09:41:05 GMT
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Organization: via, but not speaking for : Texas Instruments Ltd.
- References: <199911191725.SAA07077@davinci.thp.univie.ac.at>
- Reply-To: Nick Ing-Simmons <nik at tiuk dot ti dot com>
Jonathan Thornburg <jthorn@galileo.thp.univie.ac.at> writes:
>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?
Well the only higher -O level that does anything is -O3, and IRRC all
that does is inline functions, so that would make code bigger and
may not make it faster as cache and paging issues mean inlining is not
always a win.
>
>If not, perhaps the build instructions should say something about higher
>optimization levels?
--
Nick Ing-Simmons <nik@tiuk.ti.com>
Via, but not speaking for: Texas Instruments Ltd.