Fix undefined behavior (left shift of negative value) in SystemZ backend.
[oota-llvm.git] / lib / Target / SystemZ / SystemZFrameLowering.cpp
index db1a005353b1cec43b7d84a03e55f3088a2acd56..eff4ae3baf3f506682f68d49941ac39682e5a8e3 100644 (file)
@@ -294,7 +294,7 @@ static void emitIncrement(MachineBasicBlock &MBB,
     else {
       Opcode = SystemZ::AGFI;
       // Make sure we maintain 8-byte stack alignment.
-      int64_t MinVal = -int64_t(1) << 31;
+      int64_t MinVal = -uint64_t(1) << 31;
       int64_t MaxVal = (int64_t(1) << 31) - 8;
       if (ThisVal < MinVal)
         ThisVal = MinVal;