https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111002
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- here is the corrected patch: diff --git a/gcc/match.pd b/gcc/match.pd index 851f1af6eac..81666f28465 100644 --- a/gcc/match.pd +++ b/gcc/match.pd @@ -4718,6 +4718,15 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) && types_match (TREE_TYPE (@0), truth_type_for (type))) (vec_cond @0 (convert! @1) (convert! @2)))) +/* Likewise for view_convert of nop_conversions. */ +(simplify + (view_convert (vec_cond:s @0 @1 @2)) + (if (VECTOR_TYPE_P (type) && VECTOR_TYPE_P (TREE_TYPE (@1)) + && known_eq (TYPE_VECTOR_SUBPARTS (type), + TYPE_VECTOR_SUBPARTS (TREE_TYPE (@1))) + && tree_nop_conversion_p (TREE_TYPE (type), TREE_TYPE (TREE_TYPE (@1)))) + (vec_cond @0 (view_convert! @1) (view_convert! @2)))) + /* Sink binary operation to branches, but only if we can fold it. */ (for op (tcc_comparison plus minus mult bit_and bit_ior bit_xor lshift rshift rdiv trunc_div ceil_div floor_div round_div