<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:echristo@gmail.com" title="Eric Christopher <echristo@gmail.com>"> <span class="fn">Eric Christopher</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Inefficient tls code for initial exec X86_64"
   href="https://llvm.org/bugs/show_bug.cgi?id=17580">bug 17580</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>FIXED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Inefficient tls code for initial exec X86_64"
   href="https://llvm.org/bugs/show_bug.cgi?id=17580#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED FIXED - Inefficient tls code for initial exec X86_64"
   href="https://llvm.org/bugs/show_bug.cgi?id=17580">bug 17580</a>
              from <span class="vcard"><a class="email" href="mailto:echristo@gmail.com" title="Eric Christopher <echristo@gmail.com>"> <span class="fn">Eric Christopher</span></a>
</span></b>
        <pre>Looks fixed to me:

dzur:~/tmp> cat > foo.c
 __thread int obj;

int test() {
  return ((int)&obj) > 0;
}
dzur:~/tmp> clang -S -O2 foo.c -o -
    .text
    .file    "foo.c"
    .globl    test
    .align    16, 0x90
    .type    test,@function
test:                                   # @test
    .cfi_startproc
# BB#0:
    movq    $obj@TPOFF, %rax
    addl    %fs:0, %eax
    testl    %eax, %eax
    setg    %al
    movzbl    %al, %eax
    retq
.Lfunc_end0:
    .size    test, .Lfunc_end0-test
    .cfi_endproc

    .type    obj,@object             # @obj
    .section    .tbss,"awT",@nobits
    .globl    obj
    .align    4
obj:
    .long    0                       # 0x0
    .size    obj, 4


    .ident    "clang version 3.7.0 (trunk 238526) (llvm/trunk 238524)"
    .section    ".note.GNU-stack","",@progbits
dzur:~/tmp> gcc -S -O2 foo.c -o -
    .file    "foo.c"
foo.c: In function ‘test’:
foo.c:4:11: warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]
   return ((int)&obj) > 0;
           ^
    .text
    .p2align 4,,15
    .globl    test
    .type    test, @function
test:
.LFB0:
    .cfi_startproc
    movq    %fs:0, %rax
    addq    $obj@tpoff, %rax
    testl    %eax, %eax
    setg    %al
    movzbl    %al, %eax
    ret
    .cfi_endproc
.LFE0:
    .size    test, .-test
    .globl    obj
    .section    .tbss,"awT",@nobits
    .align 4
    .type    obj, @object
    .size    obj, 4
obj:
    .zero    4
    .ident    "GCC: (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4"
    .section    .note.GNU-stack,"",@progbits</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>