http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56028



--- Comment #2 from Paul E. McKenney <paulmck at linux dot vnet.ibm.com> 
2013-01-18 11:25:52 UTC ---

(In reply to comment #1)

> - Does language standard guarantee atomic store in this case [wikipedia says

> "No." [1]]?



The above example of device drivers storing constants to a device register

declared as "volatile unsigned long y" does not require all of the attributes

of an atomic store, for example, it does not require memory-fence instructions.



> - Can a store to a volatile DImode location be implemented as two consecutive

> SImode stores to adjacent location (this breaks stores of 64bit immediates to

> MMIO 64bit registers)?



See 1.9p8 of the C++11 standard, first bullet:



"Access to volatile objects are evaluated strictly according to the rules of

the abstract machine."



>From what I can see, implementing a store to a volatile DImode location as two

consecutive SImode stores to adjacent locations violates this aspect of the

standard.  Furthermore, to expand on your parenthesized statement above, gcc

might not operate reliably if the device drivers in the kernel it is running on

have their 64-bit immediate stores broken into pairs of 32-bit immediate

stores.  ;-)



> [1] http://en.wikipedia.org/wiki/Volatile_variable#In_C_and_C.2B.2B

Reply via email to