Messages in this thread | | | Date | Thu, 15 Jul 2010 21:48:36 -0700 | From | "H. Peter Anvin" <> | Subject | Re: [patch 134/149] x86, paravirt: Add a global synchronization point for pvclock |
| |
On 07/14/2010 01:45 PM, Zachary Amsden wrote: > That's the kind of bug I think Linus is talking about. We've been > expecting volatile to work that way for over a decade, by my > recollection, and if it doesn't, there is going to be a lot of broken code. > > Shouldn't we at least get a compiler switch to force the volatile > behavior? I'd suggest it default to conservative.
At this point, it looks like there is no reason to be alarmed. The documentation actually contains a statement about volatiles not being mutually reordered across sequence points, and since asm is a statement (rather than an expression) it is always surrounded by sequence points. I have filed a gcc ticket to ask for clarification.
-hpa
-- H. Peter Anvin, Intel Open Source Technology Center I work for Intel. I don't speak on their behalf.
| |