From de5b5228631d14e272ec8bf93827dea3da16a33d Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Mon, 27 Aug 2018 17:08:50 +0300 Subject: [PATCH] match.pd: add single-use check for (x & y) ^ y -> ~x & y (PR 85758) PR tree-optimization/85758 * match.pd ((X & Y) ^ Y): Add :s qualifier to inner expression. From-SVN: r263887 --- gcc/ChangeLog | 5 +++++ gcc/match.pd | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5ecd5f60e1d..123d76c8680 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-08-27 Alexander Monakov + + PR tree-optimization/85758 + * match.pd ((X & Y) ^ Y): Add :s qualifier to inner expression. + 2018-08-27 David Malcolm PR 87091 diff --git a/gcc/match.pd b/gcc/match.pd index cb3c93e3e16..d43e52d05cd 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -1027,7 +1027,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (for opo (bit_and bit_xor) opi (bit_xor bit_and) (simplify - (opo:c (opi:c @0 @1) @1) + (opo:c (opi:cs @0 @1) @1) (bit_and (bit_not @0) @1))) /* Given a bit-wise operation CODE applied to ARG0 and ARG1, see if both -- 2.30.2