This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Difference between two optimization settings
- From: Thomas Heinz <thomasheinz at gmx dot net>
- To: Eljay Love-Jensen <eljay at adobe dot com>
- Cc: GCC-help <gcc-help at gcc dot gnu dot org>
- Date: Sat, 28 Jun 2008 15:36:57 +0200
- Subject: Re: Difference between two optimization settings
- References: <C48BA3CD.6837%eljay@adobe.com>
Hi Eljay
Thanks for your quick reply.
> -O0
> Performs no optimizations. It disables (bypasses) all the optimization
> machinery. Should make compile time faster, and easier to debug (-g),
> but may hide certain bad (language non-compliant) bugs at runtime (which
> may give a false impression that the code is correct), and won't
> generate a few warnings from -Wall -Wextra which depend on optimization
> analysis.
>
> -O1 -fno-yadayada...
> Enables many optimizations, and the mentioned -fno-yadayada... flags
> will disable that handful of specific optimizations. (Most of the
> optimizations have no independently twiddle-able flags.)
>
> I like this trick to see which twiddle-able flags were enabled:
>
> gcc -O1 -S -fverbose-asm -x c <(echo '') -o O1.s
> cat O1.s
>
> (Your command-line may differ, depending on your platform.)
Do you (or someone else) know how to enable only constant propagation +
constant folding in an -O0 optimization setting?
I guess it's necessary to tweak the code, isn't it?
If so, how much effort would it be?
Cheers,
Thomas