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:56:22 PDT 2013


On Sep 3, 2013, at 9:53 AM, Rafael EspĂ­ndola <rafael.espindola at gmail.com> wrote:

>>> 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.
> 
> Another thing that is making -O1 better defined is asan. It is the
> optimization level that makes asan fast but still provides useful
> backtraces :-)

Ok, makes sense.  Those uses can use an explicit -O1 though :-)

> 
>> 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 :-)
> 
> I haven't seen -O being used in wild, so I OK with keeping it mapping to -O2.

I'd be curious to know how many files in a linux distro are built with -O.  I wouldn't be surprised if it is  5-10%.

-Chris



More information about the cfe-commits mailing list