1ULL << 64 is undefined, don't do it.
authorChris Lattner <sabre@nondot.org>
Sat, 8 Jan 2005 06:24:30 +0000 (06:24 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 8 Jan 2005 06:24:30 +0000 (06:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19365 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 357275eb24413476a30cba54bce68d4997793dff..4ad651718f561a4652da9f412b171d10f47cac48 100644 (file)
@@ -218,8 +218,9 @@ SelectionDAG::~SelectionDAG() {
 SDOperand SelectionDAG::getConstant(uint64_t Val, MVT::ValueType VT) {
   assert(MVT::isInteger(VT) && "Cannot create FP integer constant!");
   // Mask out any bits that are not valid for this constant.
-  Val &= (1ULL << MVT::getSizeInBits(VT)) - 1;
-
+  if (VT != MVT::i64)
+    Val &= ((uint64_t)1 << MVT::getSizeInBits(VT)) - 1;
+  
   SDNode *&N = Constants[std::make_pair(Val, VT)];
   if (N) return SDOperand(N, 0);
   N = new ConstantSDNode(Val, VT);