From 596b4fde343b4e89ba627b3c1f02c09b50307e57 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 18 Nov 2025 08:12:33 +0100 Subject: [PATCH] tree-optimization/122723 - fix multi-step mask conversion The following fixes the logic in multi-step mask conversions with respect to the case where we need to resort to the sbool variant of the unpack optabs. We were testing a wrong condition on when that would apply in the multi-step case. PR tree-optimization/122723 * tree-vect-stmts.cc (supportable_widening_operation): Correct optab to query in the multi-step case when it is supposed to hit the sbool case. --- gcc/tree-vect-stmts.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/tree-vect-stmts.cc b/gcc/tree-vect-stmts.cc index 2bc68e25b90..bc15ac9d085 100644 --- a/gcc/tree-vect-stmts.cc +++ b/gcc/tree-vect-stmts.cc @@ -14047,9 +14047,9 @@ supportable_widening_operation (vec_info *vinfo, TYPE_UNSIGNED (prev_type)); if (VECTOR_BOOLEAN_TYPE_P (intermediate_type) - && VECTOR_BOOLEAN_TYPE_P (prev_type) - && intermediate_mode == prev_mode - && SCALAR_INT_MODE_P (prev_mode)) + && VECTOR_BOOLEAN_TYPE_P (wide_vectype) + && intermediate_mode == TYPE_MODE (wide_vectype) + && SCALAR_INT_MODE_P (intermediate_mode)) { /* If the input and result modes are the same, a different optab is needed where we pass in the number of units in vectype. */ -- 2.47.3