fix an infinite loop
authorChris Lattner <sabre@nondot.org>
Wed, 13 Apr 2005 20:06:29 +0000 (20:06 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 13 Apr 2005 20:06:29 +0000 (20:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21289 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 64774c2fe41e8820707a749dc4aaba61c3b83442..0a4b88ba6d4170e5287f01dfaa6d1742d7de911c 100644 (file)
@@ -795,7 +795,7 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
 
       // If we are anding the result of a setcc, and we know setcc always
       // returns 0 or 1, simplify the RHS to either be 0 or 1
-      if (N1.getOpcode() == ISD::SETCC &&
+      if (N1.getOpcode() == ISD::SETCC && C2 != 1 &&
           TLI.getSetCCResultContents() == TargetLowering::ZeroOrOneSetCCResult)
         if (C2 & 1)
           return getNode(ISD::AND, VT, N1, getConstant(1, VT));