http://llvm.org/bugs/show_bug.cgi?id=3985

           Summary: x86 and x86-64 don't implement the local dynamic TLS
                    mode.
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: lli
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


gcc with -fPIC on x86-64 compiles

static int __thread a;
static int __thread b;
int f(void)
{
  return a + b;
}

to
        leaq    b...@tlsld(%rip), %rdi
        call    __tls_get_a...@plt
        movq    %rax, %rdx
        movl    b...@dtpoff(%rax), %eax
        addl    a...@dtpoff(%rdx), %eax
        ret

and on X86 to

        pushl   %esi
        pushl   %ebx
        call    ___i686.get_pc_thunk.bx
        addl    $_GLOBAL_OFFSET_TABLE_, %ebx
        leal    b...@tlsldm(%ebx), %eax
        call    ___tls_get_a...@plt
        movl    %eax, %esi
        movl    b...@dtpoff(%eax), %eax
        addl    a...@dtpoff(%esi), %eax
        popl    %ebx
        popl    %esi
        ret

note that there is only one call to ___tls_get_addr. We should implement that
on llvm.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- 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

Reply via email to