From 0222adbcd25779a156399bcc16fde9f6d083a809 Mon Sep 17 00:00:00 2001 From: Vedant Kumar Date: Mon, 20 Jun 2016 21:24:26 +0000 Subject: [tsan] Do not instrument accesses to the gcov counters array There is a known intended race here. This is a follow-up to r264805, which disabled tsan instrumentation for updates to instrprof counters. For more background on this please see the discussion in D18164. llvm-svn: 273202 --- llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp') diff --git a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp index eed77b701e3..22a26d49374 100644 --- a/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp @@ -271,6 +271,10 @@ static bool shouldInstrumentReadWriteFromAddress(Value *Addr) { /*AddSegment=*/false))) return false; } + + // Check if the global is in the GCOV counters array. + if (GV->getName() == "__llvm_gcov_ctr") + return false; } return true; } -- cgit v1.2.3