summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-03-04 23:21:33 +0000
committerChris Lattner <sabre@nondot.org>2005-03-04 23:21:33 +0000
commitcfe2822cdf70822d696a474ea0d53d31df45fc30 (patch)
tree227fccca96a5a69a2867dcfa58579bfe5c5d14b2 /llvm/lib/Transforms
parent6cc4ee0f24c81c06f31aaa90813809712611db0f (diff)
downloadbcm5719-llvm-cfe2822cdf70822d696a474ea0d53d31df45fc30.tar.gz
bcm5719-llvm-cfe2822cdf70822d696a474ea0d53d31df45fc30.zip
Do not compute 1ULL << 64, which is undefined. This fixes Ptrdist/ks on the
sparc, and testcase Regression/Transforms/InstCombine/2005-03-04-ShiftOverflow.ll llvm-svn: 20445
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index a90dde6c8aa..e944672d262 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -2563,7 +2563,8 @@ Instruction *InstCombiner::visitSetCondInst(BinaryOperator &I) {
Constant *Mask;
if (CI->getType()->isUnsigned()) {
unsigned TypeBits = CI->getType()->getPrimitiveSize()*8;
- Val &= (1ULL << TypeBits)-1;
+ if (TypeBits != 64)
+ Val &= (1ULL << TypeBits)-1;
Mask = ConstantUInt::get(CI->getType(), Val);
} else {
Mask = ConstantSInt::get(CI->getType(), Val);
OpenPOWER on IntegriCloud