https://bugs.llvm.org/show_bug.cgi?id=37770
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: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
$ 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:
********************
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.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs