News for hackers. Stuff that matters.
Re:GCC Non-bugs by zamalek on Monday March 02, 2015 @03:14AM (#9130860)
Thanks for the clarification. So this doesn't signal to the compiler that it shouldn't optimize the aliased variables?

Reason I ask and not test is that it seems that VC++ does not take advantage of this undefined behavior and the sample code always works 'as expected'.

Re:GCC Non-bugs by pjmlp on Monday March 02, 2015 @04:22AM (#9131036)
This type of optimization is very compiler specific and can even change between versions of the same compiler.

Actually this is the big difference between standard defined languages and those that rely on a single implementation.

There is nothing to rely upon if it isn't defined in the standard as such.