Re: [PATCH] ICF: properly handle LABEL_DECLs (PR tree-opt/81696).

2017-08-08 Thread Martin Liška
On 08/08/2017 01:17 PM, Richard Biener wrote:
> On Tue, Aug 8, 2017 at 1:11 PM, Martin Liška  wrote:
>> Hello.
>>
>> As LABEL_DECL can point to another function (non-local goto), we must 
>> properly
>> compare them.
>>
>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>
>> Ready to be installed ?
> 
> Ok.

Thanks.

> 
> So with bb1 == bb2 == NULL could you equate them in case the DECL_CONTEXT
> functions were merged by ICF (and the labels)?  (I guess it's not
> worth the trouble)

No, that would be very rare case.

Martin

> 
> Thanks,
> Richard.
> 
>> Martin
>>
>> gcc/ChangeLog:
>>
>> 2017-08-08  Martin Liska  
>>
>> PR tree-opt/81696
>> * ipa-icf-gimple.c (func_checker::compare_cst_or_decl): Consider
>> LABEL_DECLs that can be from a different function.
>>
>> gcc/testsuite/ChangeLog:
>>
>> 2017-08-08  Martin Liska  
>>
>> PR tree-opt/81696
>> * gcc.dg/ipa/pr81696.c: New test.
>> ---
>>  gcc/ipa-icf-gimple.c   |  6 +-
>>  gcc/testsuite/gcc.dg/ipa/pr81696.c | 26 ++
>>  2 files changed, 31 insertions(+), 1 deletion(-)
>>  create mode 100644 gcc/testsuite/gcc.dg/ipa/pr81696.c
>>
>>



Re: [PATCH] ICF: properly handle LABEL_DECLs (PR tree-opt/81696).

2017-08-08 Thread Richard Biener
On Tue, Aug 8, 2017 at 1:11 PM, Martin Liška  wrote:
> Hello.
>
> As LABEL_DECL can point to another function (non-local goto), we must properly
> compare them.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed ?

Ok.

So with bb1 == bb2 == NULL could you equate them in case the DECL_CONTEXT
functions were merged by ICF (and the labels)?  (I guess it's not
worth the trouble)

Thanks,
Richard.

> Martin
>
> gcc/ChangeLog:
>
> 2017-08-08  Martin Liska  
>
> PR tree-opt/81696
> * ipa-icf-gimple.c (func_checker::compare_cst_or_decl): Consider
> LABEL_DECLs that can be from a different function.
>
> gcc/testsuite/ChangeLog:
>
> 2017-08-08  Martin Liska  
>
> PR tree-opt/81696
> * gcc.dg/ipa/pr81696.c: New test.
> ---
>  gcc/ipa-icf-gimple.c   |  6 +-
>  gcc/testsuite/gcc.dg/ipa/pr81696.c | 26 ++
>  2 files changed, 31 insertions(+), 1 deletion(-)
>  create mode 100644 gcc/testsuite/gcc.dg/ipa/pr81696.c
>
>