From: Steven Wu Date: Thu, 10 Sep 2015 16:32:28 +0000 (+0000) Subject: Fix an undefined behavior introduces in r247234 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d4c5df76da223f5be8c40080f6164f73f3ffb0a8;p=oota-llvm.git Fix an undefined behavior introduces in r247234 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247296 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp b/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp index afacfa5c90f..6c538c9741d 100644 --- a/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp +++ b/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp @@ -646,7 +646,7 @@ bool AArch64DAGToDAGISel::SelectAddrModeIndexed7S(SDValue N, unsigned Size, if (ConstantSDNode *RHS = dyn_cast(N.getOperand(1))) { int64_t RHSC = RHS->getSExtValue(); unsigned Scale = Log2_32(Size); - if ((RHSC & (Size - 1)) == 0 && RHSC >= (-0x40 << Scale) && + if ((RHSC & (Size - 1)) == 0 && RHSC >= -(0x40 << Scale) && RHSC < (0x40 << Scale)) { Base = N.getOperand(0); if (Base.getOpcode() == ISD::FrameIndex) {