On Wed, Jan 13, 2010 at 9:22 AM, Mark Mentovai <[email protected]> wrote:
> Dan Kegel wrote:
>> On Wed, Jan 13, 2010 at 9:12 AM, Stephen White <[email protected]> 
>> wrote:
>>> 2)  Most of the supposed performance advantage of strict aliasing rules is
>>> probably taken care of by memory disambiguation in modern (ie., Core2 and
>>> later) CPUs.
>>
>> I kind of doubt that.  Disallowing aliasing lets the compiler do
>> a number of high-level optimizations that the chip could never do on its own.
>> See e.g.
>> http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html
>>
>> I'm for -fstrict-aliasing except for third_party.
>
> Me too.
>
> I support -fstrict-aliasing or not specifying anything explicitly (as
> we presently do), and only using -fno-strict-aliasing for specific
> third_party libraries that are known to need it.

One argument for Stephen's side: much of our performance-critical code
is in WebKit, which relies on no-strict-aliasing.

At the code level I think it's not too hard for us to be aliasing
correct (people like Craig have already fixed all of the places where
we were wrong, and we have tools like bit_cast<> in basictypes.h to
make it not too painful), so I'm not too opposed to it.

But on a practical note, the default only matters on Linux with gcc
4.4, which is not a build configuration we (Google) yet use
extensively, which means that we break solely but frequently for
third-party builds:
  http://code.google.com/p/chromium/issues/list?can=1&q=strict+aliasing
 (note how much of those mention "fedora" or "ubuntu")

With that in mind I think we should explicitly use
-fno-strict-aliasing until someone is willing to take the time to run
buildbots, track down regressions, etc. for the other configuration.
(Consider https://bugs.webkit.org/show_bug.cgi?id=30827 as the sort of
bug we've run into.)  Albert has expressed some interest in getting us
to use gcc 4.4 as our baseline compiler so maybe that will happen in
the future.
-- 
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to