aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Glisse <marc.glisse@inria.fr>2016-05-04 07:38:18 +0200
committerMarc Glisse <glisse@gcc.gnu.org>2016-05-04 05:38:18 +0000
commite07ab2feaf8f83bfab64ef0746b4fb8ee65033d3 (patch)
tree90949559170da664351679fa8ded68ef59b5e99d
parent0777ce6f2efd582e6ad8902b3a5458e21fbc8a16 (diff)
downloadgcc-e07ab2feaf8f83bfab64ef0746b4fb8ee65033d3.zip
gcc-e07ab2feaf8f83bfab64ef0746b4fb8ee65033d3.tar.gz
gcc-e07ab2feaf8f83bfab64ef0746b4fb8ee65033d3.tar.bz2
Remove duplicate (A & B) OP (C & B) in match.pd.
2016-05-04 Marc Glisse <marc.glisse@inria.fr> * match.pd ((A | B) & (A | C)): Generalize to BIT_XOR_EXPR. Mark as commutative. Check both conversions are NOP. ((A & B) OP (C & B)): Remove. From-SVN: r235858
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/match.pd15
2 files changed, 11 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 77d81cc..6461fc1 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-04 Marc Glisse <marc.glisse@inria.fr>
+
+ * match.pd ((A | B) & (A | C)): Generalize to BIT_XOR_EXPR. Mark
+ as commutative. Check both conversions are NOP.
+ ((A & B) OP (C & B)): Remove.
+
2016-05-04 Alan Modra <amodra@gmail.com>
* combine.c (simplify_set): Correct WORD_REGISTER_OPERATIONS test.
diff --git a/gcc/match.pd b/gcc/match.pd
index 8de8858..ee2aee3 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -685,11 +685,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
constants are involved. For example, convert
(A | B) & (A | C) into A | (B & C)
Further simplification will occur if B and C are constants. */
-(for op (bit_and bit_ior)
- rop (bit_ior bit_and)
+(for op (bit_and bit_ior bit_xor)
+ rop (bit_ior bit_and bit_and)
(simplify
- (op (convert? (rop:c @0 @1)) (convert? (rop @0 @2)))
- (if (tree_nop_conversion_p (type, TREE_TYPE (@0)))
+ (op (convert? (rop:c @0 @1)) (convert? (rop:c @0 @2)))
+ (if (tree_nop_conversion_p (type, TREE_TYPE (@1))
+ && tree_nop_conversion_p (type, TREE_TYPE (@2)))
(rop (convert @0) (op (convert @1) (convert @2))))))
@@ -787,12 +788,6 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(bitop:c (rbitop:c (bit_not @0) @1) @0)
(bitop @0 @1)))
-/* Simplify (A & B) OP0 (C & B) to (A OP0 C) & B. */
-(for bitop (bit_and bit_ior bit_xor)
- (simplify
- (bitop (bit_and:c @0 @1) (bit_and @2 @1))
- (bit_and (bitop @0 @2) @1)))
-
/* (x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2) */
(simplify
(bit_and (bit_ior @0 CONSTANT_CLASS_P@1) CONSTANT_CLASS_P@2)