https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116202
Bug ID: 116202 Summary: RISC-V: Miscompile at -O3 with zvl256b 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: int b[24]; _Bool c[24]; int main() { for (int f = 0; f < 4; ++f) b[f] = 6; for (int f = 0; f < 24; f += 4) c[f] = ({ int g = ({ unsigned long g = -b[f]; 1 < g ? 1 : g; }); g; }); __builtin_printf("%u\n", c[0]); } Commands: > /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc > -march=rv64gcv_zvl256b -O3 red.c -o user-config.out -fsigned-char > -fno-strict-aliasing -fwrapv > QEMU_CPU=rv64,vlen=256,rvv_ta_all_1s=true,rvv_ma_all_1s=true,v=true,vext_spec=v1.0,zve32f=true,zve32x=true,zve64d=true,zve64f=true,zve64x=true > timeout --verbose -k 0.1 4 > /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/qemu-riscv64 > user-config.out 255 > /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc > -march=rv64gcv_zvl256b -O2 red.c -o user-config.out -fsigned-char > -fno-strict-aliasing -fwrapv > QEMU_CPU=rv64,vlen=256,rvv_ta_all_1s=true,rvv_ma_all_1s=true,v=true,vext_spec=v1.0,zve32f=true,zve32x=true,zve64d=true,zve64f=true,zve64x=true > timeout --verbose -k 0.1 4 > /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/qemu-riscv64 > user-config.out 1 Found via fuzzer.