On Tue, 2005-11-22 at 19:10, Robert Dewar wrote: > Dave Korn wrote: > > Robert Dewar wrote: > > > > > Isn't it pretty much implied by point 1, "Not more than one volatile > > memory > > ref appears in the instructions being considered"? > > No, that allows a volatile reference to be combined with something else. > I think this is a mistake, because people often think of volatile as > guaranteeing what Ada would call an atomic access, one instruction > accessing just the variable and nothing else.
If there are N volatile accesses in the sequence under consideration, there must be exactly N volatile accesses in the resulting combination (the only thing I've missed in my list is to say that the volatile reference can't be eliminated -- I've already restricted N to 1, and rule 4 already said that the mode of the access couldn't change). There is, however, a further restriction that I thought of last night. This is very hard to maintain generally, and may therefore be a near show-stopper: 5) The instruction must never need to be restarted after the volatile access has been accepted by the memory system. This restriction rules out, for example, using a volatile value as an input in many floating point operations (since the operations may trap depending on the values read). R.