https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116715
--- Comment #1 from Patrick O'Neill <patrick at rivosinc dot com> ---
Slightly improved testcase:
int a, b;
int d;
long f = 695372830942;
int main() {
d = 0;
for (; d < 1; d = 1)
--f;
d |= b = f;
long h = d;
a = h >> 40;
__builtin_printf("%lX\n", a);
}
> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc
> -march=rv64idzbs -O2 preprocessed.c -o test.out -fsigned-char &&
> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/qemu-riscv64 test.out
0
> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/riscv64-unknown-linux-gnu-gcc
> -march=rv64idzbs -O1 preprocessed.c -o test.out -fsigned-char &&
> /scratch/tc-testing/tc-compiler-fuzz-trunk/build-gcv/bin/qemu-riscv64 test.out
FFFFFFFFFFFFFFFF