<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - clang-cl can't generate COFF symbol for aligned tentative array."
   href="https://bugs.llvm.org/show_bug.cgi?id=37770">37770</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang-cl can't generate COFF symbol for aligned tentative array.
          </td>
        </tr>

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

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

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, peter@pcc.me.uk, rnk@google.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat foo.c
struct Foo { int x; } __attribute__((__aligned__(64))) foos[];

$ clang-cl -c foo.c
fatal error: error in backend: alignment is limited to 32-bytes
clang-cl.exe: error: clang frontend command failed with exit code 70 (use -v to
see invocation)
clang version 7.0.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: D:\src\llvmbuild\cl\Release\x64\bin
clang-cl.exe: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang-cl.exe: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-cl.exe: note: diagnostic msg: D:\Temp\align-aa2798.c
clang-cl.exe: note: diagnostic msg: D:\Temp\align-aa2798.sh
clang-cl.exe: note: diagnostic msg:

********************

Although the error is being generated on the backend, it's happening because
the frontend is giving invalid IR.  Discussing with rnk offline, it seems like
we shouldn't be trying to emit a common symbol for this at all.  Double
checking against MSVC, I can confirm that it doesn't and MSVC will accept this
code.

Right now the only way to get this to work is to compile with -fno-common or
change the alignment.</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>