diff options
author | Chris Lattner <sabre@nondot.org> | 2005-01-08 06:24:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-01-08 06:24:30 +0000 |
commit | 623f70dd4c5525888aca400c27832282913b539e (patch) | |
tree | 14fc5a132861bb5087ae08e1a75d713249811b5d /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 7ab65934a0b126d198ff17dd4bc734ddd0d46dd4 (diff) |
1ULL << 64 is undefined, don't do it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 357275eb24..4ad651718f 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -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); |