Skip to content

Bad interaction of `-funbox-small-strict-fields and unboxed tuples`.

There we have a similar issue to #21737 (closed)

The problem is this:

-- W will contain the ints directly
data T = T !(# Int, Int, ..., Int #)
data W = W !T

-- W2 will unbox W, since it assumes the unboxed tuple to be a single value and doesn't
-- account for (# #) already being unboxed.
data T2 = T2 !( Int, Int, Int)
data W2 = W2 !T2

When deciding if we should unpack T into T2 we will see that T has just a single field (the unpacked tuple) so we unpack. However this ignores the fact that unboxed tuples are always "unpacked" increasing the size of W to an potentially arbitrary size.

Edited by Andreas Klebinger
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information