[LLVMbugs] [Bug 17581] New: Unnecessary use of local dynamic on x86_64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 14 15:13:30 PDT 2013


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: unassignedbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    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 at TLSLD(%rip), %rdi
    callq    __tls_get_addr at PLT
    movq    $obj at DTPOFF, %rcx
    addl    %eax, %ecx

which is 21 bytes 

without the hidden attribute clang itself produces

    data16
    leaq    obj at TLSGD(%rip), %rdi
    data16
    data16
    rex64
    callq    __tls_get_addr at PLT

which is 16 bytes.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131014/443f0128/attachment.html>


More information about the llvm-bugs mailing list