]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add missing expand_vec_cond_expr_p to patterns
authorRichard Biener <rguenther@suse.de>
Fri, 23 Jan 2026 09:02:09 +0000 (10:02 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 23 Jan 2026 12:23:14 +0000 (13:23 +0100)
The following adds another missing check on VEC_COND_EXPR
expandability.  Without a testcase.

* match.pd ((convert (vec_cond ...))): Make sure the
resulting vec_cond can be expanded.

gcc/match.pd

index 155658fe2c83abc10bed3e47312c3d5df709c3b7..b66fd9022eb3708c428eb2b4b4f7da169154c251 100644 (file)
@@ -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. */