[PATCH][ARM] Fix assertion failure in SjLjEHPrepare

Bob Wilson bob.wilson at apple.com
Mon May 13 13:40:16 PDT 2013


On May 13, 2013, at 11:15 AM, Kai Nacke <kai at redstar.de> wrote:

> On 13.05.2013 19:55, Bob Wilson wrote:
>> 
>> On May 13, 2013, at 10:47 AM, Kai Nacke <kai at redstar.de> wrote:
>> 
>>> On 08.05.2013 19:38, Renato Golin wrote:
>>>> 
>>>> Looks reasonable, but I'd wait until some Darwin expert chime in.
>>>> 
>>> 
>>> Are there any Darwin expert around here?
>> 
>> Yes, we have some of those.  Kai, can you provide a test case that demonstrates the problem?  We compile lots of ARM code with EH for Darwin and have not been hitting this problem.  I'd like to understand what's different that causes you to hit this assertion.
>> 
> 
> For sure! Attached is exc4.ll which crashes llc using -march=arm -mtriple=arm-darwin -filetype=obj.
> 
> The IR is a reduced version of the following D code, produced by LDC:
> 
> extern(C) void bar();
> 
> extern(C) void foo()
> {
>    try
>    {
>        bar();
>    }
>    finally
>    {
>    }
> }

OK, I understand now.  Clang emits the bitcast on the landing pads:

landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)

Apparently the D compiler is omitting that bitcast.  I don't see anything in langref that requires the personality function to be an i8*, and in fact, the example in the doc shows it without that bitcast.

The patch is OK.



More information about the llvm-commits mailing list