[LLVMdev] ExtractBasicBlock() on block that ends with invoke or unreachable triggers assert() in llc

Duncan Sands
Sun, 06 Jun 2010 18:26:34 -0000

Hi Gregory,

> llc: SelectionDAGISel.cpp:358: virtual bool
> llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&):
> Assertion `FuncInfo->CatchInfoFound.size() =>
FuncInfo->CatchInfoLost.size()&&  "Not all catch info was
assigned to
> a landing pad!"' failed.
> 0  libLLVM-2.7.so 0x0140e2c8
> Stack dump:
> 0.	Program arguments: llc -O0 bullet.linked.bc.opt
> 1.	Running pass 'X86 DAG->DAG Instruction Selection' on function
>
'@_ZN15DemoApplication20localCreateRigidBodyEfRK11btTransformP16btCollisionShape'
>
> LLVM 2.7, trying to extract some basic blocks from bullet.linked.bc
> file from LLVM test suite.

you get this if a call to llvm.eh.selector is not in a landing pad, i.e. not
in the basic block that some invoke instruction unwinds to.  That's because
codegen doesn't handle this case properly yet, and it seemed better to fail
with an assertion rather than generating wrong code.

Ciao,

Duncan.