On 26 August 2010 12:56, <sharj...@cse.iitb.ac.in> wrote: > > a) Is there any way to observe the effect of a particular optimization, > without the obvious option of using a lot of -fno switches. > b) And do the -f* switches serve any purpose, if I can't enable individual > optimizations using them.
You need an optimisation option, -Ox, to enable optimisations, but you don't have to use -O2 to get optimisations that are normally enabled by -O2, e.g. -O1 -fstrict-aliasing will enable strict aliasing. So to answer the first question, use -O1, turn off the O1 optimisations you don't want, and selectively enable the ones you do want.