https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113576
--- Comment #42 from Richard Biener <rguenth at gcc dot gnu.org> ---
And the do_store_flag part:
diff --git a/gcc/expr.cc b/gcc/expr.cc
index fc5e998e329..44d64274071 100644
--- a/gcc/expr.cc
+++ b/gcc/expr.cc
@@ -13693,6 +13693,19 @@ do_store_flag (sepops ops, rtx target, machine_mode
mode)
subtarget = 0;
expand_operands (arg0, arg1, subtarget, &op0, &op1, EXPAND_NORMAL);
+ unsigned HOST_WIDE_INT nunits;
+ if (VECTOR_BOOLEAN_TYPE_P (type)
+ && operand_mode == QImode
+ && TYPE_VECTOR_SUBPARTS (type).is_constant (&nunits)
+ && nunits < BITS_PER_UNIT)
+ {
+ op0 = expand_binop (mode, and_optab, op0,
+ GEN_INT ((1 << nunits) - 1), NULL_RTX,
+ true, OPTAB_WIDEN);
+ op1 = expand_binop (mode, and_optab, op1,
+ GEN_INT ((1 << nunits) - 1), NULL_RTX,
+ true, OPTAB_WIDEN);
+ }
if (target == 0)
target = gen_reg_rtx (mode);
for the testcase
typedef long v4si __attribute__((vector_size(4*sizeof(long))));
typedef v4si v4sib __attribute__((vector_mask));
typedef _Bool sbool1 __attribute__((signed_bool_precision(1)));
_Bool x;
void __GIMPLE (ssa) foo (v4sib v1, v4sib v2)
{
v4sib tem;
_Bool _7;
__BB(2):
tem_5 = ~v2_2(D);
tem_3 = v1_1(D) | tem_5;
tem_4 = _Literal (v4sib) { _Literal (sbool1) -1, _Literal (sbool1) -1,
_Literal (sbool1) -1, _Literal (sbool1) -1 };
_7 = tem_3 == tem_4;
x = _7;
return;
}