This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GSoC][match-and-simplify] add more constant folding tests
- From: Prathamesh Kulkarni <bilbotheelffriend at gmail dot com>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Diego Novillo <dnovillo at google dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Maxim Kuvyrkov <maxim dot kuvyrkov at linaro dot org>
- Date: Mon, 18 Aug 2014 23:30:04 +0530
- Subject: Re: [GSoC][match-and-simplify] add more constant folding tests
- Authentication-results: sourceware.org; auth=none
- References: <CAJXstsDkM_0zvezGex8WDuoWSO4Vy_caRzDTWahrPsWD7vG=oA at mail dot gmail dot com> <1408383410 dot 2473 dot 28 dot camel at surprise>
On Mon, Aug 18, 2014 at 11:06 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> On Mon, 2014-08-18 at 01:11 +0530, Prathamesh Kulkarni wrote:
>> We now have at-least one test-case for each of constant folding
>> patterns
>> in match-constant-folding.pd
>>
>> [gcc/testsuite/gcc.dg/tree-ssa]
>> * match-constant-folding.c: Add test-cases.
>>
>> [...snip...]
>
> A minor nit for one of the comments, for modulo division:
>
>> Index: match-constant-folding.c
>> ===================================================================
>> --- match-constant-folding.c (revision 214020)
>> +++ match-constant-folding.c (working copy)
> [...]
>
>> +/* x % x -> 1 */
> ^
> 0, rather than 1, surely?
Thanks, fixed in this patch.
* testsuite/match-constant-folding.c: Fix typo.
Regards,
Prathamesh
>
>
>
Index: match-constant-folding.c
===================================================================
--- match-constant-folding.c (revision 214101)
+++ match-constant-folding.c (working copy)
@@ -64,7 +64,7 @@ int c7(int x)
}
/* { dg-final { scan-tree-dump "Match-and-simplified x_\\d\+\\(D\\) / t1_\\d\+ to x_\\d\+\\(D\\)" "ccp1" } } */
-/* x % x -> 1 */
+/* x % x -> 0 */
int c8(int x)
{
int t1 = x;