How to dump all the optimization flags enabled?

Vladimir Simonov Vladimir.Simonov@acronis.com
Thu Mar 29 15:06:00 GMT 2007



Andrew Haley wrote:
> Wei Hu writes:
>  > Hello,
>  > 
>  > Is there a way to tell gcc to print out all the effective optimization
>  > flags when it compiles a C file?
>  > I know the manual tells you what flags are set at different
>  > optimization levels, but I'm still looking for an answer to my
>  > question because it will be useful to my project.
> 
> Yes.  -fverbose-asm dumps the flags to the .s file.
> 
> Andrew.
> 
Hi,

Sorry, if probably a bit offtopic from subj.

I've created flags lists for -O0 and -O2,
made diff (see attach) and built my project
both with -O0 and -O2 -fno-{all options marked by + in diff}.

I've expected that results(binaries) will be equal.
But they are different.

Are my expectations correct?
Or -O0 and -O2 -fno-{all options marked
by + in diff} are not the same?

Regards
Vladimir
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: opts.diff
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20070329/08940499/attachment.ksh>


More information about the Gcc-help mailing list