
1 Oct
2004
1 Oct
'04
12:27 p.m.
Ben Hutchings wrote:
Peter Dimov <pdimov@mmltd.net> wrote:
Alexander Terekhov wrote:
C'mon, volatile is brain-dead.
Nobody's arguing otherwise. ;-) But a nop it isn't.
I think Alexander is arguing that without a clear definition of what it means for a memory access to be "observable",
A memory access is observable if and only if the variable is volatile. 1.9/6.
the fact that volatile memory accesses are "observable behaviour" doesn't prevent them from being optimised away under the as-if rule.
A compiler is not allowed to alter the observable behavior under the "as if" rule. 1.9/1.