<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/25 Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank" class="cremed">rnk@google.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Sun, Nov 24, 2013 at 11:54 PM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank" class="cremed">timurrrr@google.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: timurrrr<br>
Date: Mon Nov 25 01:54:55 2013<br>
New Revision: 195624<br></blockquote><div> </div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc<div class="im">

<br>

URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc?rev=195624&r1=195623&r2=195624&view=diff" target="_blank" class="cremed">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc?rev=195624&r1=195623&r2=195624&view=diff</a><br>



==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_libc.cc Mon Nov 25 01:54:55 2013<br>
@@ -18,7 +18,12 @@ namespace __sanitizer {<br>
<br>
 // Make the compiler think that something is going on there.<br>
 static inline void break_optimization(void *arg) {<br>
+#ifdef SANITIZER_WINDOWS<br>
+  // FIXME: make sure this is actually enough.<br></div></blockquote><div><br></div><div>I believe _ReadWriteBarrier is what you want:</div><div><a href="http://msdn.microsoft.com/en-us/library/f20w0x5e(v=vs.120).aspx" target="_blank" class="cremed">http://msdn.microsoft.com/en-us/library/f20w0x5e(v=vs.120).aspx</a><br>


</div><div><br></div><div>It's deprecated because people think it emits fence instructions, but it only prevents compiler reordering.  That's exactly what you want in this case.</div></div></div></div></blockquote>

<div><br></div><div>Thanks for the pointer!</div><div><br></div><div>However, I don't feel like I want to use something that's clearly marked as deprecated and was meant for a slightly different purpose and gives few benefits :)</div>

<div>Do you think volatile + /volatile:iso would help?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">

<div class="im"><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

+  __asm;<br>
+#else<br>
   __asm__ __volatile__("" : : "r" (arg) : "memory");<br>
+#endif<br>
 }<br>
<br>
 s64 internal_atoll(const char *nptr) {<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank" class="cremed">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank" class="cremed">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div><br></div></div>
</blockquote></div><br></div></div>