This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -O more than the sum of its parts?
- From: Alexey Salmin <alexey dot salmin at gmail dot com>
- To: drew stortz <drew dot stortz at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 9 Mar 2010 10:09:06 +0600
- Subject: Re: -O more than the sum of its parts?
- References: <7088dd691003081924l2c75ec98tca557585304a9e73@mail.gmail.com> <7088dd691003081931w2a9c6618of759c34753b5ac8b@mail.gmail.com>
On Tue, Mar 9, 2010 at 9:31 AM, drew stortz <drew.stortz@gmail.com> wrote:
> From the following page
>
> http://gcc.gnu.org/onlinedocs/gcc-4.2.2/gcc/Optimize-Options.html#Optimize-Options
>
> I gather that using GCC 4.2.2 with the -O option is the equivalent of
> using all of the following options explicitly: -fdefer-pop
> -fdelayed-branch -fguess-branch-probability -fcprop-registers
> -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce
> -ftree-dominator-opts -ftree-dse -ftree-ter -ftree-lrs -ftree-sra
> -ftree-copyrename -ftree-fre -ftree-ch -funit-at-a-time
> -fmerge-constants -fomit-frame-pointer
>
> However, experiment tells me that this is far from true.? When I
> compile the same c file both ways, the object file produced with -O is
> around 20% smaller than the one produced with all of the individual
> optimizations added. ?Before filing a bug or investigating further, I
> wanted to ask the list: is my interpretation of the -O switch
> incorrect?? Is it more than just the sum of those individual
> optimizations?
>
> I’m using sles9 sp3 on an x86-64 machine, and the observation hold
> whether using -m32 or -m64 and also whether I include or exclude
> -fomit-frame-pointer
>
> thanks for your help,
> Drew
>
http://gcc.gnu.org/ml/gcc-help/2009-10/msg00128.html