don't emit a 1-byte object as a .fill. This is silly and causes
authorChris Lattner <sabre@nondot.org>
Tue, 31 Jan 2012 03:39:24 +0000 (03:39 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 31 Jan 2012 03:39:24 +0000 (03:39 +0000)
CodeGen/X86/global-sections.ll to fail with CDArray

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

lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index 1e55de4494cfeb84953e5a2c62edece5bef83296..4c093665c8c7433eb7d226760690316158508b1d 100644 (file)
@@ -1615,7 +1615,9 @@ static void EmitGlobalConstantDataSequential(const ConstantDataSequential *CDS,
   int Value = isRepeatedByteSequence(CDS, AP.TM);
   if (Value != -1) {
     uint64_t Bytes = AP.TM.getTargetData()->getTypeAllocSize(CDS->getType());
-    return AP.OutStreamer.EmitFill(Bytes, Value, AddrSpace);
+    // Don't emit a 1-byte object as a .fill.
+    if (Bytes > 1)
+      return AP.OutStreamer.EmitFill(Bytes, Value, AddrSpace);
   }
   
   // If this can be emitted with .ascii/.asciz, emit it as such.