https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110817
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Hmm, we lower from v.0_1 = v; _2 = v.0_1 != { 0, 0 }; c.1_8 = c; _4 = (unsigned int) c.1_8; _3 = {_4, _4}; _10 = v.0_1 == _3; _9 = _2 | _10; _5 = VEC_COND_EXPR <_9, { 0, 0 }, { -1, -1 }>; _6 = VIEW_CONVERT_EXPR<long unsigned int>(_5); if (_6 != 0) that's v != 0 | v == c, I don't think that's equal to the original expression. Some match.pd pattern goes wrong here I think, possibly not honoring the sign of vector bools. goes wrong during forwprop1: --- a-t2.c.034t.ccp1 2023-07-27 09:22:25.683940331 +0200 +++ a-t2.c.035t.forwprop1 2023-07-27 09:22:25.683940331 +0200 @@ -6,19 +6,14 @@ Applying pattern match.pd:4716, gimple-match-2.cc:16058 Applying pattern match.pd:4586, gimple-match-2.cc:9314 Applying pattern match.pd:4586, gimple-match-2.cc:11869 +Applying pattern match.pd:5327, gimple-match-8.cc:3364 +Matching expression match.pd:1979, gimple-match-7.cc:91 +Applying pattern match.pd:4683, gimple-match-2.cc:15638 +Matching expression match.pd:1979, gimple-match-7.cc:91 ... @@ -48,10 +45,12 @@ v.2_7 = v; _8 = _4 != v.2_7; _9 = VEC_COND_EXPR <_8, { -1, -1 }, { 0, 0 }>; - _10 = _3 > _9; - _11 = VEC_COND_EXPR <_10, { -1, -1 }, { 0, 0 }>; + _10 = VEC_COND_EXPR <_2, { 0, 0 }, _8>; + _18 = _4 == v.2_7; + _17 = _2 | _18; + _11 = VEC_COND_EXPR <_17, { 0, 0 }, { -1, -1 }>; _12 = VIEW_CONVERT_EXPR<V>(_11); - _13 = VIEW_CONVERT_EXPR<long unsigned int>(_12); + _13 = VIEW_CONVERT_EXPR<long unsigned int>(_11); if (_13 != 0)