This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][3,4,5/n] Merge from match-and-simplify, fold, fold_stmt and first patterns
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Jakub Jelinek <jakub at redhat dot com>
- Date: Fri, 24 Oct 2014 13:34:17 +0200 (CEST)
- Subject: Re: [PATCH][3,4,5/n] Merge from match-and-simplify, fold, fold_stmt and first patterns
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1410241237490 dot 9891 at zhemvz dot fhfr dot qr> <alpine dot DEB dot 2 dot 11 dot 1410241326120 dot 1647 at laptop-mg dot saclay dot inria dot fr>
On Fri, 24 Oct 2014, Marc Glisse wrote:
>
> > + /* Same applies to modulo operations, but fold is inconsistent here
> > + and simplifies 0 % x to 0, only preserving literal 0 % 0. */
> > + (for op (ceil_mod floor_mod round_mod trunc_mod)
> > + /* 0 % X is always zero. */
> > + (simplify
> > + (trunc_mod integer_zerop@0 @1)
> > + /* But not for 0 % 0 so that we can get the proper warnings and errors.
> > */
> > + (if (!integer_zerop (@1))
> > + @0))
> > + /* X % 1 is always zero. */
> > + (simplify
> > + (trunc_mod @0 integer_onep)
> > + { build_zero_cst (type); }))
>
> "op" is unused, you probably meant to replace trunc_mod with it.
Oh, indeed. I'll fix that up next week (heh - sth for a first warning
from genmatch!).
Thanks,
Richard.