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
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117594
Richard Biener changed:
What|Removed |Added
Last reconfirmed||2024-11-15
Ever confirmed|0
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
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
>
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 +=
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) {