Do not use asm-based 16-byte CAS if compiled with TSan (Linux/x64)
authorIvan Maidanski <ivmai@mail.ru>
Tue, 28 Nov 2017 08:28:32 +0000 (11:28 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 30 Nov 2017 15:52:02 +0000 (18:52 +0300)
(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

index f3c7d87..28b0f17 100644 (file)
@@ -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    */