[llvm-commits] proposed patch to make mips16 exception handling work

Reed Kotler rkotler at mips.com
Sun Nov 4 11:07:19 PST 2012

The main idea is to distinguish between emitting normal labels and debug 
labels. This is the nomenclature chosen by the gcc people working on 
this same problem.

I have just added one EmitDebugLabel call, because that is all that is 
needed for now to get exceptions to work.

For the general dwarf, the call needs to be made most likely for all 
labels apart from the landing pad label.

By default normal and debug labels will be the same.

For Mips, I emit debug labels as:


instead of


On 11/04/2012 11:00 AM, Reed Kotler wrote:
> I have posted some notes on this subject in the llvm developer area.
> Probably this patch should be comitted in two pieces, if accepted. The
> general change to mcstreamer and dwarf emitter, and the target specific
> mips16 piece. The mcstreamer and dwarf emitter part could also be split
> in two.
> There may be a better way to do this but this works and is reasonably
> clean.
> See discussion of "symbols for exception handling" in the developers list.
> The crux of the problem is that the linker adds a 1 to addresses of
> mips16 routines.
> When you call a function, the ISA determines whether you are in mips16
> or mips32 by the presence
> or absence of this bit.
> Some notes from the gcc mips16 checkins for this explain a lot of the
> issues.
> http://gcc.gnu.org/ml/gcc-patches/2008-08/msg00623.html
> http://gcc.gnu.org/ml/gcc-patches/2008-11/msg01273.html
> I will add a test case for the mips specific part.
> I have post commit review privilege for the mips area but not for any
> target independent areas.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits-Tmj1lob9twqVc3sceRu5cw at public.gmane.org
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

More information about the llvm-commits mailing list