<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - mis-compile of TLS+alias (extracted from glibc's errno.c)"
   href="http://llvm.org/bugs/show_bug.cgi?id=21288">21288</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>mis-compile of TLS+alias (extracted from glibc's errno.c)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>david.majnemer@gmail.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>kcc@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>test case (extracted from glibc's csu/errno.c): 

__thread int TL_WITH_ALIAS;
extern __thread int __libc_errno __attribute__ ((alias ("TL_WITH_ALIAS")));

gcc produces tbss. 
clang produces bss.     (tested with clang r219701 on x86_64 linux)

Chandler says to show this to David Majnemer

% for c in gcc clang; do $c -S p.c  -o -; echo =======================; done 
    .file    "p.c"
    .globl    TL_WITH_ALIAS
    .section    .tbss,"awT",@nobits
    .align 4
    .type    TL_WITH_ALIAS, @object
    .size    TL_WITH_ALIAS, 4
TL_WITH_ALIAS:
    .zero    4
    .globl    __libc_errno
    .set    __libc_errno,TL_WITH_ALIAS
    .ident    "GCC: (Ubuntu 4.8.2-19ubuntu1) 4.8.2"
    .section    .note.GNU-stack,"",@progbits
=======================
    .text
    .file    "p.c"
    .type    TL_WITH_ALIAS,@object   # @TL_WITH_ALIAS
    .bss
    .globl    TL_WITH_ALIAS
    .align    4
TL_WITH_ALIAS:
    .long    0                       # 0x0
    .size    TL_WITH_ALIAS, 4


    .globl    __libc_errno
__libc_errno = TL_WITH_ALIAS
    .ident    "clang version 3.6.0 (219701)"
    .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>