[clang] [llvm] [BasicAA] Do not decompose past casts with different index width (PR #119365)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 4 21:23:05 PDT 2025


liushuyu wrote:

Hi there,

It seems like after this pull request, the following C code will crash LLVM if LLVM assertion is enabled:

Godbolt link: https://godbolt.org/z/91bqnYsb4

```c
#include <stdint.h>
#include <stddef.h>

#if SIZE_MAX != UINT32_MAX
#error "This reproducer only works on 32-bit targets"
#endif

void repro(unsigned char** arg0) {
    #pragma clang loop unroll(disable)
    for (size_t i = 0; i != INT32_MAX / 2 + 1; i++) {
        *arg0[i] = 0;
        arg0[i] = 0;
    }
}
```

Reduced LLVM IR that can trigger the issue: https://godbolt.org/z/aj364W849

https://github.com/llvm/llvm-project/pull/119365


More information about the cfe-commits mailing list