[Bug target/117594] [15] RISC-V: Miscompile at -O3 since r15-4012-gba7632674a2

2024-11-15 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117594 Patrick O'Neill changed: What|Removed |Added Summary|[15] RISC-V: Miscompile at |[15] RISC-V: Miscompile at

[Bug target/117594] [15] RISC-V: Miscompile at -O3

2024-11-15 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117594 Richard Biener changed: What|Removed |Added Last reconfirmed||2024-11-15 Ever confirmed|0

[Bug target/117594] [15] RISC-V: Miscompile at -O3

2024-11-14 Thread pan2.li at intel dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117594 --- Comment #4 from Li Pan --- I can reproduce this. └─(07:29:53 on master⚑ ✭)──> QEMU_CPU=rv64,vlen=128,rvv_ta_all_1s=true,rvv_ma_all_1s=true,v=true,vext_spec=v1.0 ~/bin/qemu/bin/qemu-riscv64 test.elf

[Bug target/117594] [15] RISC-V: Miscompile at -O3

2024-11-14 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117594 --- Comment #3 from Patrick O'Neill --- Yep 36 looks correct but I get a zero for -O3: > /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc > -march=rv64gcv -O3 red.c -o user-config.out -fno-strict-aliasing >

[Bug target/117594] [15] RISC-V: Miscompile at -O3

2024-11-14 Thread rdapp at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117594 --- Comment #2 from Robin Dapp --- What's the expected output of the latter test case? I'm seeing 36 no matter what I try, -O3, -O2 without 'v', etc. Even with an x86 GCC. And, looking at the loop for (unsigned j = 0; j < (z[i] ?: 10); j +=

[Bug target/117594] [15] RISC-V: Miscompile at -O3

2024-11-14 Thread patrick at rivosinc dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117594 --- Comment #1 from Patrick O'Neill --- Testcase that doesn't underflow: unsigned a; short b, d, e; long long c; int main() { short h = d; short *z = &h; for (_Bool i = 0; i < 1; i = 1) for (unsigned j = 0; j < (z[i] ?: 10); j += 3) {