https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122478

--- Comment #7 from Artemiy Volkov <artemiyv at acm dot org> ---
FWIW, I have

diff --git a/gcc/match.pd b/gcc/match.pd
index 00493d6ad99..88216c7ee53 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -5658,10 +5658,10 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)

 /* Squash view_converts of BFRs if no precision is lost.  */
 (simplify
-  (view_convert (BIT_FIELD_REF @1 @2 @3))
+  (view_convert (BIT_FIELD_REF@0 @1 @2 @3))
   (if (is_gimple_reg_type (type)
        && (!INTEGRAL_TYPE_P (type)
-          || type_has_mode_precision_p (type)))
+          || TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0))))
    (BIT_FIELD_REF:type @1 @2 @3)))

 /* For integral conversions with the same precision or pointer

spinning on everything at the moment. (As you say, this will provide
type_has_mode_precision_p (TREE_TYPE (@0)) implicitly.)

Reply via email to