Issue 84350
Summary [RISC-V] Miscompile at -O2
Labels new issue
Assignees
Reporter patrick-rivos
    Testcase:
```c
int printf(const char *, ...);
long a;
short b = 2;
char c(unsigned char d, unsigned char e) { return e == 0 ?: d % e; }
int main() {
  char f;
  a = 1;
  f = c(0 <= 7, b);
  a ^= f;
  printf("%lX\n", a);
}
```

Commands:
```bash
> /scratch/tc-testing/tc-mar-5-llvm-slp-ice-2/build/bin/clang -O2 red.c -o red.out
> /scratch/tc-testing/tc-mar-4-llvm/build/bin/qemu-riscv64 red.out
FFFFFFFFFFFFFFFE
> /scratch/tc-testing/tc-mar-5-llvm-slp-ice-2/build/bin/clang red.c -o red.out
> /scratch/tc-testing/tc-mar-4-llvm/build/bin/qemu-riscv64 red.out
0
```

`-opt-bisect-limit` points to `Type Promotion on function (main)`

This is a recent regression.
Known good hash: 083d8aa03aca55b88098a91e41e41a8e321a5721
Known bad hash: 8f79cdd8da97c131ae7d8a3210bb69cb6654903d

Found via fuzzer
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to