diff options
| author | Jim Laskey <jlaskey@mac.com> | 2006-06-15 19:37:14 +0000 |
|---|---|---|
| committer | Jim Laskey <jlaskey@mac.com> | 2006-06-15 19:37:14 +0000 |
| commit | 3519b877583f478465c424e42d803cfe93fb5e1d (patch) | |
| tree | 068e8b0959821bcd523b75ea1e3755955f536371 /llvm | |
| parent | 9095eec0a2aac2645c4e1cc76b568cdaeb5a5cf1 (diff) | |
| download | bcm5719-llvm-3519b877583f478465c424e42d803cfe93fb5e1d.tar.gz bcm5719-llvm-3519b877583f478465c424e42d803cfe93fb5e1d.zip | |
Was pointed out that structure alignment and type alignment are not the same
thing. Doubles still need to be special cased.
llvm-svn: 28806
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index c5d6cb206fb..9f00fb2bff2 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -250,6 +250,9 @@ unsigned AsmPrinter::getPreferredAlignmentLog(const GlobalVariable *GV) const { Alignment = Log2_32(GV->getAlignment()); if (GV->hasInitializer()) { + // Always round up alignment of global doubles to 8 bytes. + if (GV->getType()->getElementType() == Type::DoubleTy && Alignment < 3) + Alignment = 3; if (Alignment < 4) { // If the global is not external, see if it is large. If so, give it a // larger alignment. |

