Fix for PR1022 (folding loads of static initializers) by Dan Gohman.
authorEvan Cheng <evan.cheng@apple.com>
Wed, 29 Nov 2006 01:38:07 +0000 (01:38 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Wed, 29 Nov 2006 01:38:07 +0000 (01:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32000 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index fbfd3f7b710bfcafe0cf94c0a1eda40bd77c5846..3a4e457161e676b196b99026e7a7231851de94ad 100644 (file)
@@ -3257,7 +3257,7 @@ static SDOperand getMemsetStringVal(MVT::ValueType VT,
   if (TLI.isLittleEndian())
     Offset = Offset + MSB - 1;
   for (unsigned i = 0; i != MSB; ++i) {
-    Val = (Val << 8) | Str[Offset];
+    Val = (Val << 8) | (unsigned char)Str[Offset];
     Offset += TLI.isLittleEndian() ? -1 : 1;
   }
   return DAG.getConstant(Val, VT);