strict aliasing

Andrew Haley aph@redhat.com
Wed Dec 16 11:02:00 GMT 2009


Andi Hellmund wrote:

> 
>> First of all is there any website, link or docu (whatever) which lists some
>> examples of what is legal (under strict aliasing) and what is not ?
>>   
> As the C standard is quite formal, here's a handy explanation about
> strict aliasing rules and how they could affect compiler optimizations:
> 
> http://cellperformance.beyond3d.com/articles/2006/06/understanding-strict-aliasing.html

But the C standard is correct.

I don't believe that the technique in CASTING THROUGH A UNION (2)
is correct.

This line:

  3  U32*     in = (U32*)&arg;

is bogus.

Andrew.



More information about the Gcc-help mailing list