gcc optimization option flags

Andrew Haley aph@redhat.com
Mon May 11 09:26:00 GMT 2009


M R Swami Reddy wrote:
> Hello Andrew,
> I used the -O1 and options listed with --verbose-asm separately, but the
> generated .s file differs. Did I miss some more options apart from the
> --verbose-asm listed?
> 
> For ex:
>  > gcc -O1 test.c -S -o test-o1.s
> 
>  > gcc test.c "option listed in .s file with -version" -S  -o
> test-listopts.s
> 
> test-o1.s and test-listopts.s are differs.

They do, and that's right.  Unless you select -O you don't get any
optimizations, no matter what other flags you set.

Andrew.



More information about the Gcc-help mailing list