[LLVMdev] ARM and lowerinvoke

Duncan Sands baldrick at free.fr
Wed Apr 22 00:08:38 PDT 2009


Hi Jim,

> I'm looking at the lowerinvoke pass as a starting point for getting  
> SJLJ based exception handling working on ARM, but am having some  
> troubles with it. When I run a simple testcase (attached) through llc  
> and specify -enable-correct-eh-support, llc asserts on me. It appears  
> there's been some bitrot somewhere. SelectDAGBuild and  
> SelectionDAGISel cooperate to track landing pads with CatchInfoLost  
> and CatchInfoFound and make sure they're all handled. However,  
> lowerinvoke throws a wrench into that by getting rid of the explicit  
> invokes, so SelectionDAGISel never identifies any landing pads, and  
> then complains with:
> Assertion failed: (FuncInfo->CatchInfoFound.size() == FuncInfo- 
>  >CatchInfoLost.size() && "Not all catch info was assigned to a  
> landing pad!"), function runOnFunction, file /Volumes/Home/grosbaj/ 
> sources/llvm-public/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp,  
> line 350.

the lowerinvoke pass doesn't know anything about LLVM's exception
handling intrinsics, eh.exception and eh.selector.  The code generator
checks that these intrinsics only turn up in landing pads.  Since lower
invoke gets rid of landing pads but doesn't touch the intrinsics, you
get this failure.

> Is it reasonable to expect that lowerinvoke is a good place to start  
> for doing what I'm after? Assuming so, I could use a bit of background  
> education on what's going on with this assertion and how to correct  
> it. Where is a good place to look to get that?

I think the first thing to do is to understand how sj/lj exceptions
are implemented in gcc.  I don't understand this myself.  It looks
like a lot of the dwarf and sj/lj code is unified.

Ciao,

Duncan.



More information about the llvm-dev mailing list