aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Criswell <criswell@uiuc.edu>2004-02-09 22:15:33 +0000
committerJohn Criswell <criswell@uiuc.edu>2004-02-09 22:15:33 +0000
commitccb2a677aff9c038b119d74f4c62295e2c4adef4 (patch)
treef5f5c2eca4c5d643b5959d89c36620a7967e940a
parent56e670557f62f82a201126082fa1663fe781b5bc (diff)
Fix PR#226: When emitting padding, always emit it as bytes. Bytes can be
placed into any alignment situation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11247 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/SparcV9/SparcV9AsmPrinter.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
index 5bb2ee62e8..863ffd7007 100644
--- a/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
+++ b/lib/Target/SparcV9/SparcV9AsmPrinter.cpp
@@ -184,14 +184,11 @@ namespace {
}
void PrintZeroBytesToPad(int numBytes) {
- for (/* no init */; numBytes >= 8; numBytes -= 8)
- printSingleConstantValue(Constant::getNullValue(Type::ULongTy));
-
- if (numBytes >= 4) {
- printSingleConstantValue(Constant::getNullValue(Type::UIntTy));
- numBytes -= 4;
- }
-
+ //
+ // Always use single unsigned bytes for padding. We don't know upon
+ // what data size the beginning address is aligned, so using anything
+ // other than a byte may cause alignment errors in the assembler.
+ //
while (numBytes--)
printSingleConstantValue(Constant::getNullValue(Type::UByteTy));
}