https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68714
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- +/* Sink logical operations below the transformation from a bool vector to a + mask. */ +(if (!(cfun->curr_properties & PROP_gimple_lvec)) + (for bitop (bit_and bit_ior bit_xor) + (simplify + (bitop (vec_cond @0 integer_all_onesp@2 integer_zerop@3) + (vec_cond @1 integer_all_onesp integer_zerop)) + (vec_cond (bitop @0 @1) @2 @3)))) Helps, but then we have: _8 = x_1(D) <= y_2(D); _6 = VEC_COND_EXPR <_8, { -1, -1, -1, -1 }, { 0, 0, 0, 0 }>; vector lowering calls expand_vec_cond_expr_p using the type of _8 (when the comparison is inside rhs1, it uses the type of x) which goes through get_vcond_mask_icode so it answers false (on everything but x86), and the VEC_COND_EXPR is lowered to a horrible sequence of _5 = BIT_FIELD_REF <_8, 32, 0>; _3 = _5 != 0; _4 = _3 ? -1 : 0; [...] _6 = {_4, _11, _14, _17}; Easiest might be to get expand_vector_condition to look at the defining statement of rhs1 (and make sure expand does the same). And maybe ping all target maintainers with a vector mode that they may want to implement vcond_mask (when I look at the x86 implementation, it uses vec_merge with a third argument of vector type, while the doc still says that it has to be a const_int bit mask), or maybe provide a default for platforms where the bool and mask vector types are essentially the same.