Limit COFF 'common' emission to <=32 alignment types.
authorErich Keane <erich.keane@intel.com>
Tue, 8 Jan 2019 18:44:22 +0000 (18:44 +0000)
committerErich Keane <erich.keane@intel.com>
Tue, 8 Jan 2019 18:44:22 +0000 (18:44 +0000)
commit85c622497190a445947c8bf09d4e18a295f134c5
tree50efee2cef4e866042caa2ce19422c4a3f52cf0b
parent6ccc173b97232a5f685b0b01d916792834feba9e
Limit COFF 'common' emission to <=32 alignment types.

As reported in PR33035, LLVM crashes if given a common object with an
alignment of greater than 32 bits. This is because the COFF file format
does not support these alignments, so emitting them is broken anyway.

This patch changes any global definitions greater than 32 bit alignment
to no longer be in 'common'.

https://bugs.llvm.org/show_bug.cgi?id=33035

Differential Revision: https://reviews.llvm.org/D56391

Change-Id: I48609289753b7f3b58c5e2bc1712756750fbd45a
llvm-svn: 350643
clang/lib/CodeGen/CodeGenModule.cpp
clang/test/CodeGen/microsoft-no-common-align.c [new file with mode: 0644]