This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][3,4,5/n] Merge from match-and-simplify, fold, fold_stmt and first patterns


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]