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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to