delphij's Chaos

选择chaos这个词是因为~~实在很难找到一个更合适的词来形容这儿了……

18 Nov 2004

About strict-aliasing optimization

What is strict aliasing? To make the long thing short, it means that the compiler apply strictest aliasing rules applicable to the language and having these assumptions the optimizer can do further optimizations.

To quote gcc manual:

Allows the compiler to assume the strictest aliasing rules applicable to the language being compiled. For C (and C++), this activates optimizations based on the type of expressions. In particular, an object of one type is assumed never to reside at the same address as an object of a different type, unless the types are almost the same. For example, an unsigned int can alias an int, but not a void* or a double. A character type may alias any other type.