Closed
Description
See the following program: https://godbolt.org/z/YhdKov4x1
There's a number of inconsistencies in how this is emitted.
-
sizeof(_Complex _BitInt(144))
is 48, but the actual size of the declared variable is 64. -
A struct with two
_BitInt
s has a size of 48, both in sizeof and allocation. -
The code in the
set
function is wrong:%arrayidx.imagp = getelementptr inbounds i8, ptr %p, i64 32 store i144 1, ptr %p, align 8 store i144 1, ptr %arrayidx.imagp, align 8
If we allocate a memory area of size 48 and then perform these stores, we will write outside of the allocation (32 + 18 = 50).
Compare this to the
set2
function, which designates the imaginary member at offset 24.