diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-04 23:21:33 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-04 23:21:33 +0000 |
commit | 8b9081081b4a7aef0e80b51c59707fcb5f751b53 (patch) | |
tree | 1f9eee009e5c936a26e6ff733ebcaae6fec50699 /lib/Transforms/Scalar/InstructionCombining.cpp | |
parent | cff1fe5f9f35c69f504285781ba174f005b30850 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20445 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index a90dde6c8a..e944672d26 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/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); |