https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125786
Drea Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2026-06-14
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Transforming _31 | _28 into { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1 }
Transforming _37 = _29 | _32;
into _37 = _32;
Yes _31 | _28 is -1
But reassoication then places -1 in the wrong location.
>From (vectors of all -1, 0 has been shortened for easier to read):
_28 = g27.1_27 >= 0;
_29 = VEC_COND_EXPR <_28, -1, 0>;
g6 = _29;
_31 = g27.1_27 < 0;
_32 = VEC_COND_EXPR <_31, -1, 0>;
g27 = _32;
_37 = _29 | _32; // -1
_10 = _32 * _37; // So should be -_32
_11 = _10 == 0;
_12 = VEC_COND_EXPR <_11, -1, 0>;
To:
_28 = g27.1_27 >= 0;
_29 = VEC_COND_EXPR <_28, -1, 0>;
g6 = _29;
_31 = g27.1_27 < 0;
_32 = VEC_COND_EXPR <-1, -1, 0>; // See how it replaced _31 with -1 here
g27 = _32;
_37 = _32;
_10 = _32 * _37; // But there is another use of _32 here.
_11 = _10 == 0;
_12 = VEC_COND_EXPR <_11, -1, 0>;
Note I think this was exposed or caused by the patch which forced comparisons
out of VEC_COND_EXPR which was done in GCC 11 (I just can't find the commit
id).