diff options
author | Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> | 2016-10-20 07:55:28 +0000 |
---|---|---|
committer | Prathamesh Kulkarni <prathamesh3492@gcc.gnu.org> | 2016-10-20 07:55:28 +0000 |
commit | 2066ef6ac8cd3e04f46b9fceeb7b8d16eff62cf3 (patch) | |
tree | c4c0b7c3c40fd68c97f751d828328f8ef3fc6de5 /gcc/match.pd | |
parent | d480863abb1e4ed178fcc906969008c37fc68f60 (diff) | |
download | gcc-2066ef6ac8cd3e04f46b9fceeb7b8d16eff62cf3.zip gcc-2066ef6ac8cd3e04f46b9fceeb7b8d16eff62cf3.tar.gz gcc-2066ef6ac8cd3e04f46b9fceeb7b8d16eff62cf3.tar.bz2 |
re PR tree-optimization/53979 (((a ^ b) | a) not optimized to (a | b))
2016-10-20 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
PR tree-optimization/53979
* match.pd ((a ^ b) | a -> a | b): New pattern.
testsuite/
* gcc.dg/pr53979-1.c: New test-case.
* gcc.dg/pr53979-2.c: Likewise.
From-SVN: r241360
Diffstat (limited to 'gcc/match.pd')
-rw-r--r-- | gcc/match.pd | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index b782a1e..7888459 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -541,6 +541,12 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (bit_ior:c (bit_and @0 INTEGER_CST@2) (bit_and (bit_not @0) INTEGER_CST@1)) (if (wi::bit_not (@2) == @1) (bit_xor @0 @1))) + +/* PR53979: Transform ((a ^ b) | a) -> (a | b) */ +(simplify + (bit_ior:c (bit_xor:c @0 @1) @0) + (bit_ior @0 @1)) + /* Simplify (~X & Y) to X ^ Y if we know that (X & ~Y) is 0. */ #if GIMPLE (simplify |