summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-13 01:05:56 +0000
committerChris Lattner <sabre@nondot.org>2007-02-13 01:05:56 +0000
commit9056bae3be212b0a71dafab1bf282ffff947ebc5 (patch)
tree8d48b2fb837cddbd511fce8f3e850e7ee0fb2ce5 /llvm/lib
parent72df49f5069b0ba46ee6d562c5d5f58da1165ba0 (diff)
downloadbcm5719-llvm-9056bae3be212b0a71dafab1bf282ffff947ebc5.tar.gz
bcm5719-llvm-9056bae3be212b0a71dafab1bf282ffff947ebc5.zip
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 llvm-svn: 34216
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 16d25ee2259..0dd762e58d2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/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();
}
};
OpenPOWER on IntegriCloud