[PATCH, PR middle-end/66134] Fix coalescing for bounds used in abnormal phi

Ilya Enkovich enkovich.gnu@gmail.com
Mon May 18 12:35:00 GMT 2015


2015-05-18 12:48 GMT+03:00 Richard Biener <richard.guenther@gmail.com>:
> On Fri, May 15, 2015 at 11:43 AM, Ilya Enkovich <enkovich.gnu@gmail.com> wrote:
>> Hi,
>>
>> This patch fixes misuse of abnormal bounds copy to avoid coalescing issue.   Bootstrapped and regtested for x86_64-unknown-linux-gnu.  Applied to trunk.  Is it OK for gcc-5?
>
> Hum.  I'm not sure how you can assert the value is defined by a
> gimple-assign.  (what about PHIs?)  also see below

Bounds defined by PHI never go to chkp_abnormal_copies.

>> @@ -1141,11 +1154,7 @@ chkp_maybe_copy_and_register_bounds (tree ptr, tree bnd)
>>        /* For abnormal copies we may just find original
>>          bounds and use them.  */
>>        if (!abnormal_ptr && !SSA_NAME_IS_DEFAULT_DEF (bnd))
>> -       {
>> -         gimple bnd_def = SSA_NAME_DEF_STMT (bnd);
>> -         gcc_checking_assert (gimple_code (bnd_def) == GIMPLE_ASSIGN);
>> -         bnd = gimple_assign_rhs1 (bnd_def);
>> -       }
>> +       bnd = chkp_get_orginal_bounds_for_abnormal_copy (bnd);
>>        /* For undefined values we usually use none bounds
>>          value but in case of abnormal edge it may cause
>>          coalescing failures.  Use default definition of
>> @@ -1177,6 +1186,7 @@ chkp_maybe_copy_and_register_bounds (tree ptr, tree bnd)
>>             copy = make_temp_ssa_name (pointer_bounds_type_node,
>>                                        gimple_build_nop (),
>
> Just pass NULL here to avoid creating a garbage NOP stmt.

OK, I'll clean up all such occurrences in tree-chkp.c.

Thanks,
Ilya



More information about the Gcc-patches mailing list