http://llvm.org/bugs/show_bug.cgi?id=17581
Bug ID: 17581
Summary: Unnecessary use of local dynamic on x86_64
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Backend: X86
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Local dynamic is not any better than general dynamic when there is only one
access. Given
__attribute__((visibility("hidden"))) __thread int obj;
int test() {
return ((int)&obj) > 0;
}
clang produces
leaq obj@TLSLD(%rip), %rdi
callq __tls_get_addr@PLT
movq $obj@DTPOFF, %rcx
addl %eax, %ecx
which is 21 bytes
without the hidden attribute clang itself produces
data16
leaq obj@TLSGD(%rip), %rdi
data16
data16
rex64
callq __tls_get_addr@PLT
which is 16 bytes.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs