Richard Biener wrote:
I wonder why wi::from_buffer doesn't have the same issue though for HImode ints. It's structured differently, without magic '4's as well.
I don't claim to understand the rest of wi::from_buffer and why it is different. However, wrt. HImode, I think the key line is:
offset = BYTES_BIG_ENDIAN ? (buffer_len - 1) - byte : byte; HTH, Alan