| Issue |
168877
|
| Summary |
[X86][GISel] Wrong code at -O0
|
| Labels |
backend:X86,
llvm:globalisel,
crash-on-valid
|
| Assignees |
|
| Reporter |
XChy
|
Testcase
```c
#include "stdio.h"
#include "stdint.h"
#include "limits.h"
int32_t g_21[5][2];
int32_t g_2121[];
int32_t func_14(int32_t, int64_t, int32_t, int32_t *, int8_t);
int32_t func_1() {
int32_t *l_20 = &g_21[4][1];
uint64_t l_2506 = 4;
*l_20 = func_14(0, 0, 2, &g_2121[0], l_2506) - 1;
return 0;
}
int32_t func_14(int32_t, int64_t, int32_t, int32_t *p_18, int8_t) {
return *p_18;
}
int main() {
func_1();
printf("checksum = %08X\n", g_21[4][1]);
}
```
Reproducer command: `clang -fglobal-isel -O0 testcase.c`
output: `checksum = 0041995F` (the output is indeterministic)
When compiling with GCC and clang with other optimization flags, the output is `checksum = FFFFFFFF`
Somehow, I cannot reproduce it on Godbolt. But I can reproduce on trunk commit 76f1949cfa0d8fed73c153af83a7054073686506 and clang-17.
And I can reproduce on both processors `Intel(R) Xeon(R) Gold 5118 CPU @ 2.30GHz` and `12th Gen Intel(R) Core(TM) i7-12700H`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs