From 2258660c6adc4ad6eb56e950cbeffedc50e9fbb0 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 28 Nov 2017 11:28:32 +0300 Subject: [PATCH] Do not use asm-based 16-byte CAS if compiled with TSan (Linux/x64) (fix commit c058d9d) Thread Sanitizer does not know the semantic of the asm synchronization instructions. * src/atomic_ops/sysdeps/gcc/x86.h [x86_64 && !ILP32 && __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 && AO_THREAD_SANITIZER] (AO_compare_double_and_swap_double_full): Do not define. --- src/atomic_ops/sysdeps/gcc/x86.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index f3c7d87..28b0f17 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -504,7 +504,8 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val, # define AO_HAVE_double_compare_and_swap_full #elif defined(AO_CMPXCHG16B_AVAILABLE) \ - || defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16) + || (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16) \ + && !defined(AO_THREAD_SANITIZER)) # include "../standard_ao_double_t.h" /* The Intel and AMD Architecture Programmer Manuals state roughly */ -- 2.50.1