Fix CodeGen/Generic/2007-02-23-DAGCombine-Miscompile.ll and PR1219

llvm-svn: 34551
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 623d9a1..073588c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -1459,11 +1459,11 @@
           case ISD::SETGT:
           case ISD::SETGE:
             // True if the sign bit of C1 is set.
-            return DAG.getConstant((C1 & (1ULL << VSize)) != 0, VT);
+            return DAG.getConstant((C1 & (1ULL << (VSize-1))) != 0, VT);
           case ISD::SETLT:
           case ISD::SETLE:
             // True if the sign bit of C1 isn't set.
-            return DAG.getConstant((C1 & (1ULL << VSize)) == 0, VT);
+            return DAG.getConstant((C1 & (1ULL << (VSize-1))) == 0, VT);
           default:
             break;
           }