This is the mail archive of the gcc-help@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: Is -O9 legitimate?


What effect does -O9 have?

It has the same effect as -O3. The -O flag will accept any number from
0-9 but only zero through three are implemented, and I don't think that
anyone has any plans to ever implement four through nine any time soon.

-O42 works, too; not just numbers smaller than 10.


The fact that people use this -O9 idiom is a little disturbing, because
it implies that they want every conceivable optimization that gcc could
possibly ever offer, even if it made compilation take weeks for no
gain.

Also if a future -O9 wouldn't work for them (perhaps it would break the C standard in a minor but significant way); also it wouldn't enable _all_ optimisations, since not all optimisation passes are a win on all code and so some wouldn't be enabled by default at any -O level.

But by design dangerous or futile optimizations do not get
enabled with -O levels because these -O options are meant to represent
blends of settings that are generally considered safe and useful by a
large range of users by the compiler authors.  So specifying -O9 is a
bit of "but this one goes to eleven!"-type nonsense, if you ask me.

Well it's _cool_, eh? :-)



Segher



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