On Wed, Apr 3, 2013 at 5:00 PM, David Rientjes <rientjes@xxxxxxxxxx> wrote: > The dereference of a volatile-qualified pointer does not guarantee that it > cannot be optimized by the compiler to be loaded multiple times into > memory even if assigned to a local variable by C99 or any previous C > standard. > > Clarify the comment of ACCESS_ONCE() to state explicitly that its current > form relies on the compiler's implementation to work correctly. This is utter bullshit and garbage. Any compiler that thinks it can load something through a "volatile" pointer multiple times is SHIT. We don't add these kinds of comments to make excuses for crap, we call out such compilers and tell people not to use the utter crap they are. The fact is, "volatile" is pretty much the only thing that can do this (and there are no sane alternate semantics that a compiler *could* use for a volatile cast), and no amount of weasel-wording by compiler apologists makes it not so. I'm not a huge fan of volatile as a C feature, but I'm even less of a fan of people trying to make excuses for bad compilers. Is there a reason why you want to add this idiotic comment? Is there a compiler that actually dismisses a volatile cast? If so, warn us about that kind of crap, and I'll happily make it very clear that people should not use the piece-of-shit compiler in question. Making excuses for that kind of compiler behavior is absolutely the last thing we should do. Linus -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>