diff --git a/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp b/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp --- a/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp +++ b/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cpp @@ -485,34 +485,14 @@ return (morder)(mo & 0x7fff); } -#define SCOPED_ATOMIC(func, ...) \ - ThreadState *const thr = cur_thread(); \ - if (UNLIKELY(thr->ignore_sync || thr->ignore_interceptors)) { \ - ProcessPendingSignals(thr); \ - return NoTsanAtomic##func(__VA_ARGS__); \ - } \ - const uptr callpc = (uptr)__builtin_return_address(0); \ - uptr pc = StackTrace::GetCurrentPc(); \ - mo = convert_morder(mo); \ - ScopedAtomic sa(thr, callpc, a, mo, __func__); \ - return Atomic##func(thr, pc, __VA_ARGS__); \ -/**/ - -class ScopedAtomic { - public: - ScopedAtomic(ThreadState *thr, uptr pc, const volatile void *a, - morder mo, const char *func) - : thr_(thr) { - FuncEntry(thr_, pc); - DPrintf("#%d: %s(%p, %d)\n", thr_->tid, func, a, mo); - } - ~ScopedAtomic() { - ProcessPendingSignals(thr_); - FuncExit(thr_); - } - private: - ThreadState *thr_; -}; +# define SCOPED_ATOMIC(func, ...) \ + ThreadState *const thr = cur_thread(); \ + ProcessPendingSignals(thr); \ + if (UNLIKELY(thr->ignore_sync || thr->ignore_interceptors)) \ + return NoTsanAtomic##func(__VA_ARGS__); \ + mo = convert_morder(mo); \ + return Atomic##func(thr, GET_CALLER_PC(), __VA_ARGS__); \ + /**/ extern "C" { SANITIZER_INTERFACE_ATTRIBUTE @@ -856,7 +836,6 @@ SANITIZER_INTERFACE_ATTRIBUTE void __tsan_atomic_thread_fence(morder mo) { - char* a = 0; SCOPED_ATOMIC(Fence, mo); } diff --git a/compiler-rt/test/tsan/atomic_free3.cpp b/compiler-rt/test/tsan/atomic_free3.cpp --- a/compiler-rt/test/tsan/atomic_free3.cpp +++ b/compiler-rt/test/tsan/atomic_free3.cpp @@ -24,5 +24,4 @@ // CHECK: #1 main // CHECK: Previous atomic write -// CHECK: #0 __tsan_atomic32_store -// CHECK: #1 Thread +// CHECK: #0 Thread diff --git a/compiler-rt/test/tsan/atomic_stack.cpp b/compiler-rt/test/tsan/atomic_stack.cpp --- a/compiler-rt/test/tsan/atomic_stack.cpp +++ b/compiler-rt/test/tsan/atomic_stack.cpp @@ -26,5 +26,4 @@ // CHECK: WARNING: ThreadSanitizer: data race // CHECK: Atomic write of size 4 -// CHECK: #0 __tsan_atomic32_fetch_add -// CHECK: #1 Thread1 +// CHECK: #0 Thread1