Switch lowering: fix assert in buildBitTests (PR23738)
authorHans Wennborg <hans@hanshq.net>
Thu, 4 Jun 2015 15:55:00 +0000 (15:55 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 4 Jun 2015 15:55:00 +0000 (15:55 +0000)
commitbebb0b5a34919d393c1d55d8e76580cbfe8d2895
tree0301692c1ffa2912bd1169e634e96987b6329621
parent9f299abc056749f22fa2f18ce217b1ba5036f0fc
Switch lowering: fix assert in buildBitTests (PR23738)

When checking (High - Low + 1).sle(BitWidth), BitWidth would be truncated
to the size of the left-hand side. In the case of this PR, the left-hand
side was i4, so BitWidth=64 got truncated to 0 and the assert failed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239048 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
test/CodeGen/X86/switch.ll