Re: Clarification on Gcc's strict aliasing rules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/09/2010 07:40 PM, Patrick Horgan wrote:
>   Most the confusion that I've seen in discussions of strict aliasing
> rules has come from developers thinking that strict aliasing is a set of
> rules telling them how to do type punning within the restrictions of the
> standard.  It's not about that at all.  Instead it's a set of rules
> telling compiler writers when they can't do some optimizations.  Of
> course developers who do type-punning do need to under-
> stand these rules to make sure that their code doesn't
> break in the presence of optimization.
> 
>   I've written a first draft of a short little paper on
> this that I hope can be referred to whenever confusion
> arises again.  The audience is really developers who
> use the compilers because the compiler writers already
> understand this.  Nevertheless, I've seen compiler
> writers and others who work on standards bodies in
> conversations where they just couldn't understand
> why communication was not happening.  They would
> benefit from reading the introduction.
> 
> http://dbp-consulting.com/StrictAliasing.pdf
> 
>   Some of it is derivative of the stuff I wrote on
> the boost developers wiki about it, but in this I talk
> a lot more about what strict aliasing is.
> 
>   I'm hoping people here who understand the issues will
> read it and email me with any corrections, examples,
> improvements etc.

The aliasing rules are nothing to do with C99: they have always
been in Standard C.

You really ought to refer to the standard, so people can see the
official rules for themselves.

Andrew.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux