]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/122723 - fix multi-step mask conversion
authorRichard Biener <rguenther@suse.de>
Tue, 18 Nov 2025 07:12:33 +0000 (08:12 +0100)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 18 Nov 2025 11:40:54 +0000 (12:40 +0100)
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

index 2bc68e25b90314112345d2d28b47160bb510c361..bc15ac9d0852f7dcc0132c4b59fda837f98826d5 100644 (file)
@@ -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.  */