diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-13 01:05:56 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-13 01:05:56 +0000 |
commit | 818d42f1e81db75300223fedb75227c17ec0ef83 (patch) | |
tree | 6937b29d02b674e7b9ae8a3b254a2671de7dd735 | |
parent | b76f903fd3a1be9d7a1770e9abe1568de9e2eee3 (diff) |
Fix switch lowering to order cases in zext order, which is how we emit the
comparisons. This fixes an infinite loop on CodeGen/Generic/switch-lower.ll
and PR1197
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34216 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 16d25ee225..0dd762e58d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -389,8 +389,8 @@ class SelectionDAGLowering { struct CaseCmp { bool operator () (const Case& C1, const Case& C2) { assert(isa<ConstantInt>(C1.first) && isa<ConstantInt>(C2.first)); - return cast<const ConstantInt>(C1.first)->getSExtValue() < - cast<const ConstantInt>(C2.first)->getSExtValue(); + return cast<const ConstantInt>(C1.first)->getZExtValue() < + cast<const ConstantInt>(C2.first)->getZExtValue(); } }; |