[dmd-internals] Regarding deprecation of volatile statements

Walter Bright walter at digitalmars.com
Wed Aug 1 11:00:25 PDT 2012


On 8/1/2012 10:20 AM, Alex Rønne Petersen wrote:
> First, the value of c.i is read and saved into a compiler-generated temporary. 
> Then, d.i is set to this temporary. Then the temporary is incremented and 
> stored into c.i. I can only guess, but is the problem you're trying to point 
> out that there might be multiple reads from c.i depending on the compiler 
> implementation? If so, I already mentioned that this is insignificant: 
> Excessive reads have no impact on semantics, but writes do. 

I've seen memory mapped I/O where the read cycles *were* important (they were 
destructive reads).

And yes, i++ can be (and sometimes is) done with multiple reads.

 > Which is how almost all compiler IRs do it. You'll rarely find compiler IRs 
that don't use explicit load and store instructions.

See dmd :-)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/dmd-internals/attachments/20120801/ae1de4d4/attachment.html>


More information about the dmd-internals mailing list