-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Labels
LTOLink time optimization (regular/full LTO or ThinLTO)Link time optimization (regular/full LTO or ThinLTO)backend:RISC-Vmiscompilationrelease:backport
Milestone
Description
Testcase:
long long s;
void hash(long long *s, long t) { *s ^= t + 9 + *s; }
signed char o[25][25][25];
unsigned a[25];
void checksum() {
for (int p = 0; p < 25; ++p)
hash(&s, a[p]);
}
int main() {
for (int p = 0; p < 25; ++p)
for (int q = 0; q < 25; ++q)
for (int u = 0; u < 25; ++u)
o[p][q][u] = 90;
for (short p = 0; p < 25; p++)
for (int q = 0; q < 25; q++) {
a[q] = -(o[p][p][p] ? o[p][4][q] : 0);
}
checksum();
__builtin_printf("%llu\n", s);
}
Commands:
# O3
$ /scratch/ewlu/daily-upstream-build/build-gcv/bin/clang -march=rv64gcv -flto -O3 red.c -o user-config.out -fsigned-char -fno-strict-aliasing -fwrapv
$ QEMU_CPU=rv64,vlen=128,rvv_ta_all_1s=true,rvv_ma_all_1s=true,v=true,vext_spec=v1.0,zve32f=true,zve64f=true timeout --verbose -k 0.1 4 /scratch/ewlu/daily-upstream-build/build-gcv/bin/qemu-riscv64 user-config.out 1
2194728288337
# O2
$ /scratch/ewlu/daily-upstream-build/build-gcv/bin/clang -march=rv64gcv -flto -O2 red.c -o user-config.out -fsigned-char -fno-strict-aliasing -fwrapv
$ QEMU_CPU=rv64,vlen=128,rvv_ta_all_1s=true,rvv_ma_all_1s=true,v=true,vext_spec=v1.0,zve32f=true,zve64f=true timeout --verbose -k 0.1 4 /scratch/ewlu/daily-upstream-build/build-gcv/bin/qemu-riscv64 user-config.out 1
72057589742960721
Found via fuzzer.
Bisected to 571c8c2 as the first bad commit
Metadata
Metadata
Assignees
Labels
LTOLink time optimization (regular/full LTO or ThinLTO)Link time optimization (regular/full LTO or ThinLTO)backend:RISC-Vmiscompilationrelease:backport
Type
Projects
Status
Needs Triage