[dmd-internals] Regarding deprecation of volatile statements
deadalnix at gmail.com
Tue Aug 7 12:18:16 PDT 2012
2012/8/1 Walter Bright <walter at digitalmars.com>
> That's what it means. But also, I have no idea what problem is addressed
> by not disallowing register allocation.
I'm not sure I get the double negation the right way, but let me explain a
very concrete example I faced.
I was doing OSless programming on an ARM device. This device also had an
RS-232 port that was memory mapped. Read and write to/from that device were
done at a given address and what you wrote to that address wasn't
correlated with what you read.
It was really important that the compiler didn't removed any read, because
2 read at the same address would give 2 consecutive bytes recieved on the
port. The same goes for write.
For that device, it was just important that the compiler don't reorder read
and write to the device, and never removed any of them.
BTW, to me, volatile is a property of the memory location, not a statement.
It fit better as a storage class that is applicable on data and that isn't
transitive. This storage class would alter the semantic access of
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dmd-internals