<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Nov 24, 2013 at 11:54 PM, Timur Iskhodzhanov <span dir="ltr"><<a href="mailto:timurrrr@google.com" target="_blank">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><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<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">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></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">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><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">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>