https://gcc.gnu.org/g:596b4fde343b4e89ba627b3c1f02c09b50307e57
commit r16-5371-g596b4fde343b4e89ba627b3c1f02c09b50307e57 Author: Richard Biener <[email protected]> Date: Tue Nov 18 08:12:33 2025 +0100 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. Diff: --- 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 2bc68e25b903..bc15ac9d0852 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. */
