This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/78294] -fsanitize=thread broken
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Nov 2016 18:53:09 +0000
- Subject: [Bug sanitizer/78294] -fsanitize=thread broken
- Auto-submitted: auto-generated
- References: <bug-78294-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78294
--- Comment #12 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Created attachment 40050
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40050&action=edit
unreduced testcase
Indeed it look like gcc simply ignores the attribute:
g++ -fPIC -O2 -g -c tsan_rtl.ii
vs.
clang++ -fPIC -O2 -g -c tsan_rtl.ii
gcc:
cur_thread()->ignore_interceptors++;
.byte 0x66
leaq _ZN6__tsan22cur_thread_placeholderE@tlsgd(%rip), %rdi #
.value 0x6666
rex64
call __tls_get_addr@PLT #
clang:
movq _ZN6__tsan22cur_thread_placeholderE@GOTTPOFF(%rip), %rax
incl %fs:131736(%rax)
movb $1,
_ZZN6__tsan10InitializeEPNS_11ThreadStateEE14is_initialized(%rip)
leaq .L.str.8(%rip), %rax
And indeed if I compile only tsan_rtl.cc with clang and the rest with gcc,
threadsanitzer works fine.