summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-02-21 20:50:42 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-02-21 20:50:42 +0000
commitd44e80d7fc718e8a8c07d9f1f68be76a111a468e (patch)
treef356d16a97493f733e499b9940ca7efae4aa7bce /llvm/lib/Transforms
parent0094e341d0a697bfb43cd3693b2d08d513295a6d (diff)
downloadbcm5719-llvm-d44e80d7fc718e8a8c07d9f1f68be76a111a468e.tar.gz
bcm5719-llvm-d44e80d7fc718e8a8c07d9f1f68be76a111a468e.zip
Don't sign extend the char when expanding char -> int during
load(bitcast(char[4] to i32*)) evaluation. llvm-svn: 65246
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index 9f72910cb75..cfd1bac7ba8 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -11028,12 +11028,12 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI,
APInt SingleChar(numBits, 0);
if (TD->isLittleEndian()) {
for (signed i = len-1; i >= 0; i--) {
- SingleChar = (uint64_t) Str[i];
+ SingleChar = (uint64_t) Str[i] & UCHAR_MAX;
StrVal = (StrVal << 8) | SingleChar;
}
} else {
for (unsigned i = 0; i < len; i++) {
- SingleChar = (uint64_t) Str[i];
+ SingleChar = (uint64_t) Str[i] & UCHAR_MAX;
StrVal = (StrVal << 8) | SingleChar;
}
// Append NULL at the end.
OpenPOWER on IntegriCloud