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

Reed Kotler rkotler at mips.com
Thu Nov 29 14:17:36 PST 2012


Ping.

On 11/09/2012 01:10 AM, Bill Wendling wrote:
> The patch looks okay to me. There should be a lot of comments about why it's necessary, similar to how the GCC code is commented.
>
> Jim, Could you take a quick look at it? I know that ARM's thumb mode has a similar thing where it adds 0x1 to the call instruction (or something like that). But I think that we can get away with it because ARM uses SjLj EH...but I just wanted to get your take on it...
>
> -bw
>
> On Nov 7, 2012, at 9:09 PM, Reed Kotler <rkotler-8NJIiSa5LzA at public.gmane.org> wrote:
>
>> Ping..
>>
>> 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.
>>
>> he 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:
>>
>> foo=.
>>
>> instead of
>>
>> foo:
>>
>> I have run "make check", the "test-suite" on x86 and all internal mips flavors with this patch and no problems arose.
>>
>>
>>
>> <mips16_patch37.txt>




More information about the llvm-commits mailing list