diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index d79df622ee5..357772c9c4f 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -1148,15 +1148,15 @@ AliasResult BasicAAResult::aliasGEP( bool AllNonPositive = DecompGEP1.Offset.isNonPositive(); for (unsigned i = 0, e = DecompGEP1.VarIndices.size(); i != e; ++i) { APInt Scale = DecompGEP1.VarIndices[i].Scale; - APInt ScaleForGDC = DecompGEP1.VarIndices[i].Scale; + APInt ScaleForGCD = DecompGEP1.VarIndices[i].Scale; if (!DecompGEP1.VarIndices[i].IsNSW) - ScaleForGDC = APInt::getOneBitSet(Scale.getBitWidth(), + ScaleForGCD = APInt::getOneBitSet(Scale.getBitWidth(), Scale.countTrailingZeros()); if (i == 0) - GCD = ScaleForGDC.abs(); + GCD = ScaleForGCD.abs(); else - GCD = APIntOps::GreatestCommonDivisor(GCD, ScaleForGDC.abs()); + GCD = APIntOps::GreatestCommonDivisor(GCD, ScaleForGCD.abs()); if (AllNonNegative || AllNonPositive) { // If the Value could change between cycles, then any reasoning about