[llvm-bugs] [Bug 37770] New: clang-cl can't generate COFF symbol for aligned tentative array.

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 11 09:38:59 PDT 2018


            Bug ID: 37770
           Summary: clang-cl can't generate COFF symbol for aligned
                    tentative array.
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: zturner at google.com
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org,
                    peter at pcc.me.uk, rnk at google.com

$ 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
https://bugs.llvm.org/ and include the crash backtrace, preprocessed source,
and associated run script.
clang-cl.exe: note: diagnostic msg:

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

Right now the only way to get this to work is to compile with -fno-common or
change the alignment.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180611/e85fbe1e/attachment.html>

More information about the llvm-bugs mailing list