This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR31096
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: "Hurugalawadi, Naveen" <Naveen dot Hurugalawadi at cavium dot com>
- Cc: Jeff Law <law at redhat dot com>, "marc dot glisse at inria dot fr" <marc dot glisse at inria dot fr>, "ramana dot radhakrishnan at foss dot arm dot com" <ramana dot radhakrishnan at foss dot arm dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 23 Nov 2016 10:56:13 +0100
- Subject: Re: [PATCH] Fix PR31096
- Authentication-results: sourceware.org; auth=none
- References: <SN2PR0701MB102491E5EF1A9EE96C8619688E990@SN2PR0701MB1024.namprd07.prod.outlook.com> <alpine.DEB.2.20.1603311120300.1831@laptop-mg.saclay.inria.fr> <SN2PR0701MB102429781DD227528814D7888E9E0@SN2PR0701MB1024.namprd07.prod.outlook.com> <alpine.DEB.2.20.1604051114350.1896@laptop-mg.saclay.inria.fr> <CO2PR07MB2694EDC68D383E78CA227D768E900@CO2PR07MB2694.namprd07.prod.outlook.com> <alpine.DEB.2.20.1604071311300.1957@laptop-mg.saclay.inria.fr> <CO2PR07MB26941B6AA9C0417C2151C59B8E950@CO2PR07MB2694.namprd07.prod.outlook.com> <alpine.DEB.2.20.1604121101050.1860@laptop-mg.saclay.inria.fr> <CO2PR07MB2694EE44E62E416C28F07DF78E970@CO2PR07MB2694.namprd07.prod.outlook.com> <24a5ed27-a4da-043c-4e99-18db1f1dad7b@redhat.com> <CO2PR07MB26943863309FC90F3CB2161983BB0@CO2PR07MB2694.namprd07.prod.outlook.com>
On Fri, Nov 11, 2016 at 11:19 AM, Hurugalawadi, Naveen
<Naveen.Hurugalawadi@cavium.com> wrote:
> Hi,
>
> Sorry for a very late reply as the mail was missed or overlooked.
>
>>> could now move the test tree_expr_nonzero_p next to
>>> tree_expr_nonnegative_p (it is redundant for the last case).
>
> Done.
>
>>> Often just a comment can really help here.
>
> Comments updated as per the suggestion
>
>>> when C is zero and verify this transformation doesn't fire on that case.
>
> Updated test to check with zero.
>
>>> verifying that the operand orders change appropriately when dealing
>>> with a negative constant.
>
> Done.
>
>>> verify nothing happens with floating point or vector types.
>
> Done.
>
> Please review the patch and let me know if any modifications are required.
> Regression tested on X86 and AArch64.
Ok with using wi::neg_p (@1, TYPE_SIGN (TREE_TYPE (@1))) instead of wi::lt_p.
Thanks,
Richard.
> Thanks,
> Naveen
>
> 2016-11-11 Naveen H.S <Naveen.Hurugalawadi@caviumnetworks.com>
> gcc
> * fold-const.c (tree_expr_nonzero_p) : Make non-static.
> * fold-const.h (tree_expr_nonzero_p) : Declare.
> * match.pd (cmp (mult:c @0 @1) (mult:c @2 @1) : New Pattern.
> * match.pd (cmp (mult:c @0 @1) (mult:c @2 @1) : New Pattern.
> gcc/testsuite
> * gcc.dg/pr31096.c: New testcase.
> * gcc.dg/pr31096-1.c: New testcase.