https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117244
Bug ID: 117244
Summary: [14/15 Regression] missed vectorization of (unsigned
int)(-(bool_var))
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: keowang at hotmail dot com
Target Milestone: ---
Starting with GCC-14, GCC seems to have missed the vectorization of the
following code.
https://godbolt.org/z/xfdW1dcM7
unsigned int a[19];
void f(bool b[19]) {
for (int i = 0; i < 19; i += 1)
{
a[i] = -b[i];
}
}
f(bool*):
xor eax, eax
.L2:
movzx edx, BYTE PTR [rdi+rax]
neg edx
mov DWORD PTR a[0+rax*4], edx
add rax, 1
cmp rax, 19
jne .L2
ret
If bisect is correct:
e6bcf83989478348428c732c11e6c0f1719e9214 is the first bad commit
https://github.com/gcc-mirror/gcc/commit/e6bcf83989478348428c732c11e6c0f1719e9214