[clang] Revert "[X86][clang] Lift _BitInt() supported max width." (PR #81175)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 15 08:24:13 PST 2024


nikic wrote:

> > It should be technically possible for Clang to give _BitInt(N) an alignment that is independent from LLVM's alignment
> 
> I'm not sure it's even technically possible: if loading a `_BitInt(129)` from memory should load 3 bytes, but it is translated to an LLVM IR load of `i129` that loads 4 bytes, then even if the last byte is ignored, simply attempting to load it may access memory out of bounds and crash the program. Storing `i129`, it would clobber the next byte of memory.

At least that shouldn't be a problem: LLVM has separate concepts of "store size" and "alloc size" where only the latter rounds up to alignment. So `load i129` is specified to access only 9 bytes, not 16 bytes.

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


More information about the cfe-commits mailing list