summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
-rw-r--r--test/CodeGen/X86/fold-pcmpeqd-2.ll5
2 files changed, 2 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 78f3f1d32a..1e55de4494 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1558,7 +1558,7 @@ static int isRepeatedByteSequence(const ConstantDataSequential *V) {
char C = Data[0];
for (unsigned i = 1, e = Data.size(); i != e; ++i)
if (Data[i] != C) return -1;
- return C;
+ return static_cast<uint8_t>(C); // Ensure 255 is not returned as -1.
}
diff --git a/test/CodeGen/X86/fold-pcmpeqd-2.ll b/test/CodeGen/X86/fold-pcmpeqd-2.ll
index a7b3332cc2..9cf4607cf5 100644
--- a/test/CodeGen/X86/fold-pcmpeqd-2.ll
+++ b/test/CodeGen/X86/fold-pcmpeqd-2.ll
@@ -8,10 +8,7 @@
; RAGreedy defeats the test by splitting live ranges.
; Constant pool all-ones vector:
-; CHECK: .long 4294967295
-; CHECK-NEXT: .long 4294967295
-; CHECK-NEXT: .long 4294967295
-; CHECK-NEXT: .long 4294967295
+; CHECK: .space 16,255
; No pcmpeqd instructions, everybody uses the constant pool.
; CHECK: program_1: