<div dir="ltr">Doesn't this mean that our implementation of _ReadWriteBarrier isn't compatible? What if it was implemented as __atomic_signal_fence(5)?</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jul 12, 2015 at 5:26 PM, Peter Collingbourne <span dir="ltr"><<a href="mailto:peter@pcc.me.uk" target="_blank">peter@pcc.me.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: pcc<br>
Date: Sun Jul 12 19:26:04 2015<br>
New Revision: 242003<br>
<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject-3Frev-3D242003-26view-3Drev&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=8_cWnrnkMWRYQJrWrokMNtAgyvDgRHIL-GIu6Rs9T1I&s=SBNqSwNIuPsQ9JLZUasJdqVEgrtqyQ2ZGsMvgGKwOYQ&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=242003&view=rev</a><br>
Log:<br>
sanitizer_common: Only use _ReadWriteBarrier when targeting MSVC cl.exe.<br>
<br>
Fixes check-ubsan when self hosting on Windows.<br>
<br>
Modified:<br>
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h<br>
<br>
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h<br>
URL: <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_viewvc_llvm-2Dproject_compiler-2Drt_trunk_lib_sanitizer-5Fcommon_sanitizer-5Fcommon.h-3Frev-3D242003-26r1-3D242002-26r2-3D242003-26view-3Ddiff&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=8_cWnrnkMWRYQJrWrokMNtAgyvDgRHIL-GIu6Rs9T1I&s=yMGYcD6V5Ccqwy0j4qsM8vOyeIbtpSkOrPBi_vvFlT8&e=" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h?rev=242003&r1=242002&r2=242003&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h (original)<br>
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common.h Sun Jul 12 19:26:04 2015<br>
@@ -661,7 +661,7 @@ void MaybeStartBackgroudThread();<br>
// compiler from recognising it and turning it into an actual call to<br>
// memset/memcpy/etc.<br>
static inline void SanitizerBreakOptimization(void *arg) {<br>
-#if _MSC_VER<br>
+#if _MSC_VER && !defined(__clang__)<br>
_ReadWriteBarrier();<br>
#else<br>
__asm__ __volatile__("" : : "r" (arg) : "memory");<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" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>