https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112673
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC|jakub at redhat dot com |jakub at gcc dot gnu.org
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think this is a match.pd problem.
First vectorizer vectorizes the
_18 = VIEW_CONVERT_EXPR<unsigned long[4]>(x)[_16];
bitint.2[_16] = _18;
...
copying loop, before forwprop4 we have
vect__18.6_34 = VIEW_CONVERT_EXPR<vector(4) unsigned long>(x_35(D));
_8 = BIT_FIELD_REF <vect__18.6_34, 64, 0>;
...
_18 = BIT_FIELD_REF <vect__18.6_34, 64, 64>;
...
etc., which I think is valid, but during forwprop4 the
(simplify
(BIT_FIELD_REF (view_convert @0) @1 @2)
(BIT_FIELD_REF @0 @1 @2))
simplification kicks in and we create invalid
_18 = BIT_FIELD_REF <x_35(D), 64, 64>;
out of it, because x has _BitInt(256) type and so doesn't have mode precision.
tree-cfg.cc checking for BIT_FIELD_REF diagnoses:
if (INTEGRAL_TYPE_P (TREE_TYPE (op))
&& !type_has_mode_precision_p (TREE_TYPE (op)))
{
error ("%qs of non-mode-precision operand", code_name);
return true;
}
so maybe
--- gcc/match.pd.jj 2023-11-17 15:10:43.306043972 +0100
+++ gcc/match.pd 2023-11-23 18:09:22.538414897 +0100
@@ -8285,7 +8285,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(simplify
(BIT_FIELD_REF (view_convert @0) @1 @2)
- (BIT_FIELD_REF @0 @1 @2))
+ (if (! INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ || type_has_mode_precision_p (TREE_TYPE (@0)))
+ (BIT_FIELD_REF @0 @1 @2)))
(simplify
(BIT_FIELD_REF @0 @1 integer_zerop)