https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94727
--- Comment #7 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- (In reply to Richard Biener from comment #6) > (In reply to rsand...@gcc.gnu.org from comment #5) > > > > However, we then defer to vect_get_slp_defs to get the actual operands. > > The expected vector type is not part of this interface. > > Ah yeah - sth on my list to fix (not making the type part of that API > but assigning vector types to SLP nodes). I even have partly completed > "hacks" to do that. When we have (and use!) vector types on all SLP > nodes we can also get rid of the mismatch code. Sounds great! The fewer decisions we make on the fly the better... > > I'm going to try: > > > > diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c > > index 7f3a9fb5fb3..88a1e2c51d2 100644 > > --- a/gcc/tree-vect-stmts.c > > +++ b/gcc/tree-vect-stmts.c > > @@ -10566,8 +10566,11 @@ vectorizable_comparison (stmt_vec_info stmt_info, > > gimple_stmt_iterator *gsi, > > /* Invariant comparison. */ > > if (!vectype) > > { > > - vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs1), > > - slp_node); > > + if (VECT_SCALAR_BOOLEAN_TYPE_P (TREE_TYPE (rhs1))) > > + vectype = mask_type; > > + else > > + vectype = get_vectype_for_scalar_type (vinfo, TREE_TYPE (rhs1), > > + slp_node); > > if (!vectype || maybe_ne (TYPE_VECTOR_SUBPARTS (vectype), nunits)) > > return false; > > } > > > > which does at least fix the testcase. > > LGTM. Thanks. aarch64-linux-gnu and x86_64-linux-gnu bootstrapped passed, now trying an SVE test run. Will commit if that passes too.