r189218 - Simplify now that -O4 just maps to -O3 and -O is an alias of -O2.

Chris Lattner clattner at apple.com
Tue Sep 3 09:45:25 PDT 2013


On Sep 3, 2013, at 9:00 AM, Daniel Dunbar <daniel.dunbar at gmail.com> wrote:

> On Sep 3, 2013, at 6:57, "Rafael EspĂ­ndola" <rafael.espindola at gmail.com> wrote:
> 
>>> I find that a bit surprising, given that -O should mean -O1.
>>> Daniel -- you changed it to mean -O2 in r82131. Any idea why?
>> 
>> Ping.
> 
> This is something Chris requested, IIRC. I'm not sure I remember the
> motivation beyond that.

Two reasons:

1) -O1 doesn't actually mean anything.  It is the optimization level least understood by both the GCC folks and us.  Recently (last 5 years?) there has been a move to try to make this "optimize without messing up debug info", but this is a new movement.

2) Users who specify -O generally don't know it maps onto -O1.  They almost certainly don't want whatever -O1 provides.  In my experience, most are coming from Sun, HP or other compilers, where -O was a generally useful flag.

3) There are some benchmarks that pass -O (because of #2), which is ridiculous, but reflects some reality that people use -O.  I don't recall what these benchmarks were.

These are reasons that I suggested the change.  I really don't like -O1 :-)

-Chris



More information about the cfe-commits mailing list