r194403 - Using an invalid -O falls back on -O3 instead of an error

Justin Bogner mail at justinbogner.com
Mon Nov 11 14:45:37 PST 2013


Hal Finkel <hfinkel at anl.gov> writes:
> Okay; it sounds like we need to make this a data-driven decision. The
> question is: of those codes using -O<n>, where n > 3, are they more
> likely to be numerics-dominated codes or more-likely to be
> control-flow-dominated codes. I remember someone posting a list here
> of # of packages (in some well-known distribution) vs. the default
> optimization flag, so this should be an answerable question.

I personally like having -Ox where x isn't something we explicitly
handle be an error. The problem with allowing "-O99" is that it
reinforces the "more is better" misconception. A lot of people don't
realize that "every optimization possible" doesn't make sense - some
optimizations conflict with another or have opposing goals.

Flags like "-O2", "-O3", and "-Os" have defined semantics, whereas
"-O99" is meaningless. The only reason, in my opinion, to accept this
would be GCC compatibility, in which case we should just do whatever
they do with it. That said, I'd still prefer this continue to be an
error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131111/c1c0c039/attachment.html>


More information about the cfe-commits mailing list