[LLVMbugs] [Bug 23738] New: SelectionDAG crashes on switch-case: Assertion failed: ((High - Low + 1).sle(BitWidth) && "Case range must fit in bit mask!")

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Jun 2 15:58:05 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23738

            Bug ID: 23738
           Summary: SelectionDAG crashes on switch-case: Assertion failed:
                    ((High - Low + 1).sle(BitWidth) && "Case range must
                    fit in bit mask!")
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: sanjoy at playingwithpointers.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Running llc on

declare void @g()
declare void @h()

define void @f(i4 %a) {
 entry:
  switch i4 %a, label %left [
    i4 0, label %right
    i4 1, label %right
    i4 -5, label %right
  ]

 right:
  call void @g()
  ret void

 left:
  call void @h()
  ret void
}

crashes with an assertion failure.

 debug+asserts-x86 $ ~/Code/llvm.git/build/release+asserts-all/bin/llc
~/tmp/reduced.ll
Assertion failed: ((High - Low + 1).sle(BitWidth) && "Case range must fit in
bit mask!"), function buildBitTests, file
../../lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp, line 7613.
0  llc                      0x000000010f7d0899
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 57
1  llc                      0x000000010f7d148b SignalHandler(int) + 875
2  libsystem_platform.dylib 0x00007fff8a866f1a _sigtramp + 26
3  llc                      0x00000001100ed45c llvm::InlineCostAnalysis::ID +
63417
4  llc                      0x000000010f7d1076 abort + 22
5  llc                      0x000000010f7d1051 __assert_rtn + 81
6  llc                      0x000000010f6f672e
llvm::SelectionDAGBuilder::buildBitTests(std::__1::vector<llvm::SelectionDAGBuilder::CaseCluster,
std::__1::allocator<llvm::SelectionDAGBuilder::CaseCluster> >&, unsigned int,
unsigned int, llvm::SwitchInst const*, llvm::SelectionDAGBuilder::CaseCluster&)
+ 5374
7  llc                      0x000000010f6f7386
llvm::SelectionDAGBuilder::findBitTestClusters(std::__1::vector<llvm::SelectionDAGBuilder::CaseCluster,
std::__1::allocator<llvm::SelectionDAGBuilder::CaseCluster> >&,
llvm::SwitchInst const*) + 3062
8  llc                      0x000000010f6c75b0
llvm::SelectionDAGBuilder::visitSwitch(llvm::SwitchInst const&) + 2560
9  llc                      0x000000010f6c4689
llvm::SelectionDAGBuilder::visit(llvm::Instruction const&) + 73
10 llc                      0x000000010f7106f8
llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction
const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 40
11 llc                      0x000000010f71036e
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 8830
12 llc                      0x000000010f70d104
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1444
13 llc                      0x000000010ede95d4 (anonymous
namespace)::X86DAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 20
14 llc                      0x000000010f19929c
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 140
15 llc                      0x000000010f40bf93
llvm::FPPassManager::runOnFunction(llvm::Function&) + 515
16 llc                      0x000000010f40c1db
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
17 llc                      0x000000010f40c793
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 1123
18 llc                      0x000000010e6c3c7a main + 8362
19 libdyld.dylib            0x00007fff96fa55c9 start + 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150602/a6147ce3/attachment.html>


More information about the llvm-bugs mailing list