From 6ec96dcb6b829b33c5d779fc19af7601c9ac1604 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 24 Jul 2018 13:29:07 +0000 Subject: [PATCH] match.pd: Add BIT_FIELD_REF canonicalizations. 2018-07-24 Richard Biener * match.pd: Add BIT_FIELD_REF canonicalizations. From-SVN: r262946 --- gcc/ChangeLog | 4 ++++ gcc/match.pd | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cf93d5f2a06..ff8ed780cf9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2018-07-24 Richard Biener + + * match.pd: Add BIT_FIELD_REF canonicalizations. + 2018-07-23 Bernd Edlinger PR c/86617 diff --git a/gcc/match.pd b/gcc/match.pd index 730bbabb593..0ae1af0ce06 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -4658,6 +4658,19 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) /* Canonicalizations of BIT_FIELD_REFs. */ +(simplify + (BIT_FIELD_REF (BIT_FIELD_REF @0 @1 @2) @3 @4) + (BIT_FIELD_REF @0 @3 { const_binop (PLUS_EXPR, bitsizetype, @2, @4); })) + +(simplify + (BIT_FIELD_REF (view_convert @0) @1 @2) + (BIT_FIELD_REF @0 @1 @2)) + +(simplify + (BIT_FIELD_REF @0 @1 integer_zerop) + (if (tree_int_cst_equal (@1, TYPE_SIZE (TREE_TYPE (@0)))) + (view_convert @0))) + (simplify (BIT_FIELD_REF @0 @1 @2) (switch -- 2.30.2