<div dir="ltr">I admit to being curious why you think volatile applies to a memory location , mainly because the last time it was discussed at length, i remember the consensus being that volatile is about the access, not the location ;-)<div><br></div><div>The langref itself specifically talks about volatile memory accesses, and volatile operations, and says things like:<br>"<span style="color:rgb(0,0,0);font-family:'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-size:14px;line-height:21px">The optimizers </span><em style="color:rgb(0,0,0);font-family:'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-size:14px;line-height:21px">may</em><span style="color:rgb(0,0,0);font-family:'Lucida Grande','Lucida Sans Unicode',Geneva,Verdana,sans-serif;font-size:14px;line-height:21px"> change the order of volatile operations relative to non-volatile operations."</span></div><div>IE it goes to lengths to talk about the operations and not the locations they refer to.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 8, 2015 at 2:40 PM, Philip Reames <span dir="ltr"><<a href="mailto:listmail@philipreames.com" target="_blank">listmail@philipreames.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">reames added a comment.<br>
<span class=""><br>
In <a href="http://reviews.llvm.org/D15352#305309" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15352#305309</a>, @majnemer wrote:<br>
<br>
> LGTM.  You have a volatile-volatile test (test25). Does it make sense to add a simple-volatile test, unordered-volatile or a simple-unordered test?<br>
<br>
<br>
</span>simple-unordered is test22 (pre-existing)<br>
<br>
The other two are probably undefined behaviour.  Our specification is a bit unclear, but volatile (I believe) applies to a memory location, not an memory access.  Thus, mixing volatile and non-volatile access to the same location is likely undefined behaviour.<br>
<br>
<br>
<a href="http://reviews.llvm.org/D15352" rel="noreferrer" target="_blank">http://reviews.llvm.org/D15352</a><br>
<br>
<br>
<br>
</blockquote></div><br></div>