https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115336
Bug ID: 115336 Summary: [15] rv64gcv_zvl256b miscompile at -O3 Product: gcc Version: 15.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: patrick at rivosinc dot com Target Milestone: --- Testcase: short d[19]; _Bool e[100][19][19]; _Bool f[10000]; int main() { for (long g = 0; g < 19; ++g) d[g] = 3; _Bool(*h)[19][19] = e; for (short g = 0; g < 9; g++) for (int i = 4; i < 16; i += 3) f[i * 9 + g] = d[i] ?: h[g][i][2]; for (long i = 120; i < 126; ++i) __builtin_printf("%d\n", f[i]); } Commands: > /scratch/tc-testing/tc-may-28/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc > -march=rv64gcv_zvl256b -O3 red.c -o red.out > QEMU_CPU=rv64,vlen=256,v=true,vext_spec=v1.0,zve32f=true,zve64f=true > /scratch/tc-testing/tc-may-28/build-rv64gcv/bin/qemu-riscv64 red.out 1 165 5 1 1 73 > /scratch/tc-testing/tc-may-28/build-rv64gcv/bin/riscv64-unknown-linux-gnu-gcc > red.c -o red.out > /scratch/tc-testing/tc-may-28/build-rv64gcv/bin/qemu-riscv64 red.out 1 1 1 1 1 1 All values should be 0 or 1 or _maybe_ 3. Found via fuzzer