The following adds another missing check on VEC_COND_EXPR
expandability.  Without a testcase.

Bootstrap and regtest running on x86_64-unknown-linux-gnu.

        * match.pd ((convert (vec_cond ...))): Make sure the
        resulting vec_cond can be expanded.
---
 gcc/match.pd | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/match.pd b/gcc/match.pd
index 155658fe2c8..b66fd9022eb 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -6249,7 +6249,9 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 (simplify
  (convert (vec_cond:s @0 @1 @2))
  (if (VECTOR_TYPE_P (type)
-      && types_match (TREE_TYPE (@0), truth_type_for (type)))
+      && types_match (TREE_TYPE (@0), truth_type_for (type))
+      && (expand_vec_cond_expr_p (type, TREE_TYPE (@0))
+         || !expand_vec_cond_expr_p (TREE_TYPE (@1), TREE_TYPE (@0))))
   (vec_cond @0 (convert! @1) (convert! @2))))
 
 /* Likewise for view_convert of nop_conversions. */
-- 
2.51.0

Reply via email to