From: Chris Lattner Date: Sun, 20 Apr 2008 19:59:12 +0000 (+0000) Subject: hopefully resolve PR2240 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3e5d1d8d0839e98ee203aa3e3c4fe84ef71eba2c;p=oota-llvm.git hopefully resolve PR2240 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49999 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 50fbe1a00c4..9f31bcdb75f 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -571,7 +571,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, if (GVAlign > 1) { unsigned DstWidth = CI2->getType()->getBitWidth(); - unsigned SrcWidth = std::min(SrcWidth, Log2_32(GVAlign)); + unsigned SrcWidth = std::min(DstWidth, Log2_32(GVAlign)); APInt BitsNotSet(APInt::getLowBitsSet(DstWidth, SrcWidth)); // If checking bits we know are clear, return zero.