[Bug middle-end/78294] [5/6/7 Regression] -fsanitize=thread broken by ignoring __attribute__((tls_model("initial-exec")))
trippels at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 16 06:15:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78294
--- Comment #14 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Here is a small testcase:
markus@x4 tsan % cat tsan_rtl.ii
__attribute__((tls_model("initial-exec"))) extern __thread char b[];
__thread char b[1];
int c;
void fn1() { c = *b; }
markus@x4 tsan % clang++ -fPIC -O2 -c tsan_rtl.ii -S -o -
...
movq b@GOTTPOFF(%rip), %rax
movsbl %fs:(%rax), %eax
movq c@GOTPCREL(%rip), %rcx
movl %eax, (%rcx)
retq
...
markus@x4 tsan % g++ -fPIC -O2 -c tsan_rtl.ii -S -o -
...
subq $8, %rsp
.cfi_def_cfa_offset 16
.byte 0x66
leaq b@tlsgd(%rip), %rdi
.value 0x6666
rex64
call __tls_get_addr@PLT
movsbl (%rax), %edx
movq c@GOTPCREL(%rip), %rax
movl %edx, (%rax)
addq $8, %rsp
...
More information about the Gcc-bugs
mailing list