This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Optimization Switches


On Thursday 26 August 2010 11:02 PM, Jonathan Wakely wrote:
On 26 August 2010 12:56,<sharjeel@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.
Thanks a lot.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]