This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix modulo patterns in match.pd
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 24 Oct 2014 15:27:19 +0200 (CEST)
- Subject: [PATCH] Fix modulo patterns in match.pd
- Authentication-results: sourceware.org; auth=none
As noted by Marc I forgot to actually utilize the iterator variable.
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
Richard.
PS: How do we want to refer to patterns in ChangeLogs?
2014-10-24 Richard Biener <rguenther@suse.de>
* match.pd (0 % X): Properly use the iterator iterating over
all modulo operators.
(X % 1): Likewise.
Index: gcc/match.pd
===================================================================
--- gcc/match.pd (revision 216648)
+++ gcc/match.pd (working copy)
@@ -64,13 +64,13 @@ (define_predicates
(for op (ceil_mod floor_mod round_mod trunc_mod)
/* 0 % X is always zero. */
(simplify
- (trunc_mod integer_zerop@0 @1)
+ (op 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)
+ (op @0 integer_onep)
{ build_zero_cst (type); }))
/* x | ~0 -> ~0 */