<html>
    <head>
      <base href="https://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 --- - -fno-zero-initialized-in-bss -fno-common and tentative definitions"
   href="https://llvm.org/bugs/show_bug.cgi?id=31625">31625</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>-fno-zero-initialized-in-bss -fno-common and tentative definitions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </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>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hstong@ca.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Clang's support for -fno-zero-initialized-in-bss does not match GCC's.
In particular, when using -fno-common, tentative definitions are still placed
by GCC into BSS.

Online compiler:
<a href="http://melpon.org/wandbox/permlink/76ugV7cPaxxqjIMl">http://melpon.org/wandbox/permlink/76ugV7cPaxxqjIMl</a>

### Source (<stdin>):
int x;


### Compiler invocation:
clang -c -o a.o -x c -fno-common -fno-zero-initialized-in-bss -


### Additional commands:
objdump -wt a.o | grep -P '\b''x\b'


### Expected output:
0000000000000000 g     O .bss    0000000000000004 x


### Actual output:
0000000000000000 g     O .data    0000000000000004 x


### clang -v:
clang version 4.0.0 (trunk 290110)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/llvm-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.3
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64</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>