diff --git a/lib/Target/PowerPC/PPCISelPattern.cpp b/lib/Target/PowerPC/PPCISelPattern.cpp index 500333fb296..9725c2c586c 100644 --- a/lib/Target/PowerPC/PPCISelPattern.cpp +++ b/lib/Target/PowerPC/PPCISelPattern.cpp @@ -640,7 +640,7 @@ static bool isRotateAndMask(unsigned Opcode, unsigned Shift, unsigned Mask, } // if the mask doesn't intersect any Indeterminant bits - if (!(Mask & Indeterminant)) { + if (Mask && !(Mask & Indeterminant)) { SH = Shift; // make sure the mask is still a mask (wrap arounds may not be) return isRunOfOnes(Mask, MB, ME);