Issue 204549
Summary Wrong code at -O1/2/3 on x86_64-linux-gnu
Labels miscompilation, llvm:optimizations, generated by fuzzer
Assignees
Reporter XChy
    Reproducer: https://godbolt.org/z/98M7cdzaT
Testcase:
```c
#include <stdint.h>
#include <stdio.h>
typedef int8_t v8i8 __attribute__((vector_size(8)));
v8i8 g6;
void *g18;
uint64_t __chk;
int main()
{
    g6 = 0 >= g6;
    int8_t v5 = 0;
lbl_cont3:
    g6 = __builtin_shufflevector(g6, g6, 9, 4, 2, 6, 3, 0, 9, 7);
    if (g18) g6 = g6 * g6;
    v5 = v5 + 4;
    switch (v5)
    {
        case 16: goto lbl_sw17;
        default: goto lbl_cont3;
    }
lbl_sw17:
    __chk = g6[5];
    printf("checksum=0x%016llx\n", (unsigned long long)__chk);
}
```

This case outputs `checksum=0x0000000000000000` at -O0, and outputs `checksum=0xffffffffffffffff` at -O1/2/3.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to