Fix PR#226: When emitting padding, always emit it as bytes. Bytes can be
authorJohn Criswell <criswell@uiuc.edu>
Mon, 9 Feb 2004 22:15:33 +0000 (22:15 +0000)
committerJohn Criswell <criswell@uiuc.edu>
Mon, 9 Feb 2004 22:15:33 +0000 (22:15 +0000)
placed into any alignment situation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11247 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SparcV9/SparcV9AsmPrinter.cpp

index 5bb2ee62e8d8f239159c740070c49c69dfac85a7..863ffd7007a39d6f8d5a4fc93653c01d8789386e 100644 (file)
@@ -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));
     }