[Bug 126] Add support for attribute to mark data as volatile.

Jens Bauer via D.gnu d.gnu at puremagic.com
Mon Apr 6 10:28:16 PDT 2015


On Sunday, 5 April 2015 at 15:58:17 UTC, Iain Buclaw wrote:
> --- Comment #24 from Iain Buclaw <ibuclaw at gdcproject.org> ---
> Compiler reordering should never mess up order of program logic 
> to variables/objects where changes are considered 'observable' 
> (eg, on shared data).  Most re-ordering/memoization happens on 
> 'non-observable' data such as local variables, thread-local 
> storage.
>
> However, that certainly doesn't stop certain C-like behaviours 
> from occuring in the optimiser.  Such include crash-inducing
> operations like divide by zero may be pushed forward to occur
> before volatile load/reads or actions with side-effects.

I find these to be very good technical details.
If there's any documentation on volatileLoad and volatileStore, I 
think the above should be added.


More information about the D.gnu mailing list