News for hackers. Stuff that matters.
Re:Wrong optimization with aliasing by caf on Monday February 15, 2016 @08:51PM (#11107415)
What you're missing is that storing to an object doesn't "access it's stored value".

Once you've stored to the malloced memory through an int-typed lvalue, it's effective type becomes int, and you can't access it (ie. read it) through a double-typed lvalue. But you can then write to it through a double-typed lvalue, because that doesn't access it's stored value - it overwrites it, and changes its effective type to double.

Re:Wrong optimization with aliasing by sharpneli on Tuesday February 16, 2016 @04:51AM (#11108847)
The specification defines the word "access" as:

access 〈execution-time action〉 to read or modify the value of an object

I would interpret that so that writing does modify the value.