Issue 244552
Summary [RISCV][P-ext] Wrong code at -O2
Labels backend:RISC-V, miscompilation, generated by fuzzer
Assignees
Reporter XChy
    Reduced case:
```c
typedef unsigned char v2u8 __attribute__((vector_size(2)));
v2u8 g14;
char g27;
void f2()
{
 if (g27) f2();
    g14 = ~(v2u8){};
}
int main()
{
    v2u8 bc10;
 do
    {
        f2();
        g27 = 1;
        bc10 = ~(v2u8){};
 bc10[g14[0] / 255] = 4;
    } while (2 / (signed char)bc10[1]);
}
```

This case triggers segfault at `-O2 - -menable-experimental-extensions -march=rv64gcp0p21`, but terminates normally at `-O0`.
The case is executed with https://github.com/ruyisdk/qemu/tree/p-dev.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to