What fine-grained options does -O2 stand for?

What fine-grained options does -O2 stand for?


I am running into a problem (with icc,icpc,ifort 11) in which -O1 yields code that produces results that are "correct" while -O2 makes code that produces results that are "incorrect". I would like to incrementally add optimization options, stepping between -O1 and -O2 to see what precisely breaks the code (and then fix the code / submit a bug report). I have been unable to find an exact list of fine-grained optimization options -O2 is an alias for. Can anybody point me to such a list so that I can debug my problem?


- Christian

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

The -list option, if available in your versions of the compilers, will give a detailed list of the options in effect.

However, I think that with source code of nontrivial size this approach will not do much for you. In particular, if there are array overruns or uninitialized variables, the interactions of those bugs with optimization options can be very unpredictable and elusive.

You may wish to try options such as -fp-model source or its components, if you haven't done so, to see whether those transformations are breaking your code. -fimf-arch-consistency=true is available in 12.0.4, but you could turn off vector math functions by -no-fast-transcendentals in 11.x. Also, the -x options have more effect at -O2 than at -O1.

Before you assume a compiler error please enable all the runtime checks.


Leave a Comment

Please sign in to add a comment. Not a member? Join today