ppc: fix for pr31281, ObjC try-catch ICEs 4.2

Stuart Hastings stuart@apple.com
Wed Mar 28 18:06:00 GMT 2007


On Mar 27, 2007, at 3:35 PM, Ian Lance Taylor wrote:

>
>> Index: gcc.fsf.42.ice1/gcc/cse.c
>> ===================================================================
>> --- gcc.fsf.42.ice1/gcc/cse.c   (revision 122999)
>> +++ gcc.fsf.42.ice1/gcc/cse.c   (working copy)
>> @@ -4542,6 +4542,14 @@ record_jump_equiv (rtx insn, int taken)
>>    op1 = fold_rtx (XEXP (XEXP (SET_SRC (set), 0), 1), insn);
>>
>>    code = find_comparison_args (code, &op0, &op1, &mode0, &mode1);
>> +
>> +  /* If the mode is VOIDmode or a MODE_CC mode, we don't know
>> +     what kinds of things are being compared, so we can't do
>> +     anything with this comparison.  */
>> +
>> +  if (mode0 == VOIDmode || GET_MODE_CLASS (mode0) == MODE_CC)
>> +    return;
>
> I don't see any reason to kick out here if mode0 == VOIDmode.  That
> seems like an unlikely case, but it also seems like a case which we
> can handle.  This is not the same as the earlier call to
> find_comparison_args.
>
> I'll approve
>    if (GET_MODE_CLASS (mode0) == MODE_CC)
>      return;
> if it fixes the bug and passes bootstrap and testing.

It does.

Do you want the testcase?  It's pretty nonsensical:

int f(unsigned int i)
{
   @try { } @catch(id) { }
   for (;;)
     for (;;)
       @try {
         if (i)
           break;
       } @catch(id) { }
}

If you want the testcase, I'm guessing it would become .../testsuite/ 
objc.dg/pr31281.m (?).

> Thanks.

Thank you for the approval,

stuart hastings
Apple



More information about the Gcc-patches mailing list