On Wed, Jan 13, 2010 at 12:19 PM, Dan Kegel <[email protected]> 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


(As a side note, I find this example somewhat contrived:  if this were
performance-critical code, the programmer would pull the dereference out of
the loop anyway, not rely on the compiler to do it.)

That said, the "data-driven" answer would be to run perf benchmarks with and
without strict aliasing, and see the effect.  It might even help us find
some hotspots which we could improve under MSVC.

I'm for -fstrict-aliasing except for third_party.
>

Whichever is decided, I think making it explicit would make life easier for
the people on different compiler versions.

Stephen

-- 
All truth passes through three stages. First, it is ridiculed. Second, it is
violently opposed. Third, it is accepted as being self-evident. --
Schopenhauer
-- 
Chromium Developers mailing list: [email protected] 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev

Reply via email to