[X86] Use the correct alignment for COMDAT constant pool entries
authorDavid Majnemer <david.majnemer@gmail.com>
Sun, 21 Feb 2016 01:30:30 +0000 (01:30 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Sun, 21 Feb 2016 01:30:30 +0000 (01:30 +0000)
commita3ea407d48eba34c712399c8885a49861ea9a741
treebd1e7ff265d796fa63c38c1af1e0eeaca075268b
parent96a01fa04671d7c554007d256294f4ddd96d3eee
[X86] Use the correct alignment for COMDAT constant pool entries

COFF doesn't have sections with mergeable contents.  Instead, each
constant pool entry ends up in a COMDAT section.  The linker, when
choosing between COMDAT sections, doesn't choose the max alignment of
the two sections.  You just get whatever alignment was on the section.

If one constant needed a higher alignment in one object file from
another one, then we will get into trouble if the linker chooses the
lower alignment one.

Instead, lets promote the alignment of the constant pool entry to make
sure we don't use an under aligned constant with an instruction which
assumed otherwise.

This fixes PR26680.

llvm-svn: 261462
llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h
llvm/include/llvm/Target/TargetLoweringObjectFile.h
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
llvm/lib/Target/TargetLoweringObjectFile.cpp
llvm/lib/Target/X86/X86AsmPrinter.cpp
llvm/lib/Target/X86/X86TargetObjectFile.cpp
llvm/lib/Target/X86/X86TargetObjectFile.h
llvm/test/CodeGen/X86/win_cst_pool.ll