Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
LWN.net Weekly Edition for May 9, 2013
(Nearly) full tickless operation in 3.10
The code we are arguing about, the one with ACCESS_ONCE(), is NOT outside the spec in any way, is it?
Posted Aug 13, 2012 12:11 UTC (Mon) by nye (guest, #51576)
> The code we are arguing about, the one with ACCESS_ONCE(), is NOT outside the spec in any way, is it?
No it isn't. The point is that, absent the ACCESS_ONCE() macro, the assumption that the compiler shouldn't pull that access out of the loop is what's outside the language spec, because the spec says it can safely do so.
Posted Aug 17, 2012 10:57 UTC (Fri) by dgm (subscriber, #49227)
But does the spec say it _has_ to do so? Does it more good or harm?
Not everything that is allowed is good. For example, the compiler is (in theory) allowed to do anything it wants when presented with code that raises undefined behavior. Anything. "rm -rf /" for instance would be 100% correct. Are GCC developers planing this "feature" for gcc 4.8? Of course not, that would be stupid when you could be playing nethack instead...
Posted Aug 13, 2012 16:35 UTC (Mon) by daglwn (subscriber, #65432)
But ignoring that, nye has the more useful response. :)
Posted Aug 17, 2012 10:37 UTC (Fri) by dgm (subscriber, #49227)
Posted Aug 20, 2012 10:07 UTC (Mon) by etienne (subscriber, #25256)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds