This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug sanitizer/78294] -fsanitize=thread broken


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]