diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2017-11-23 20:53:09 +0100 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2017-11-23 19:53:09 +0000 |
commit | d43177addfb5f32bca4845af930bb67104f1845f (patch) | |
tree | 67571b083102cb7af4453dfb20f8bcbb184b8ce9 /gcc/match.pd | |
parent | 612ea540d2e1fe5eae5213823a3cec0d3d864fb2 (diff) | |
download | gcc-d43177addfb5f32bca4845af930bb67104f1845f.zip gcc-d43177addfb5f32bca4845af930bb67104f1845f.tar.gz gcc-d43177addfb5f32bca4845af930bb67104f1845f.tar.bz2 |
Simplify ptr - 0
2017-11-23 Marc Glisse <marc.glisse@inria.fr>
* match.pd (ptr-0): New transformation.
From-SVN: r255113
Diffstat (limited to 'gcc/match.pd')
-rw-r--r-- | gcc/match.pd | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/match.pd b/gcc/match.pd index 0949a9b..84db1ee 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -102,6 +102,11 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (pointer_plus integer_zerop @1) (non_lvalue (convert @1))) +/* ptr - 0 -> (type)ptr */ +(simplify + (pointer_diff @0 integer_zerop) + (convert @0)) + /* See if ARG1 is zero and X + ARG1 reduces to X. Likewise if the operands are reversed. */ (simplify |