From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2004-10-01 07:47:38
Peter Dimov wrote:
> Ben Hutchings wrote:
>> Peter Dimov <pdimov_at_[hidden]> 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.
Yes, I understand what is observable (extensional definition). Yet the
real meaning of "observable" (intensional definition) is vague (and
>> 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.
Yet there is no statement of *how* the observable behaviour can be
observed. Observation is outside the program and outside the standard
and so practically implementation-defined. However, I do feel that
Alexander's interpretation of volatile memory access is perverse.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk