abi_limb_mode and limb_mode were asserted to be the same when the target has different endianness for limbs in _BitInts and words in objects. Otherwise, this assertion also held when the TYPE_PRECISION of _BitInt type being laid out is less than or equal to the precision of abi_limb_mode.
But in the latter case it stops us from e.g. laying out _BitInt(65) with abi_limb_mode == TImode for alignment or sizing while the actual limb for lowering stays in DImode. This patch removes this limitation. gcc/ChangeLog: * stor-layout.cc (layout_type): Reduce the conditions where the abi_limb_mode == limb_mode assertion applies. --- gcc/stor-layout.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/stor-layout.cc b/gcc/stor-layout.cc index 12071c96ca7..66a834faacc 100644 --- a/gcc/stor-layout.cc +++ b/gcc/stor-layout.cc @@ -2477,18 +2477,19 @@ layout_type (tree type) gcc_assert (ok); scalar_int_mode limb_mode = as_a <scalar_int_mode> (info.abi_limb_mode); + + if (!info.big_endian != !WORDS_BIG_ENDIAN) + gcc_assert (info.abi_limb_mode == info.limb_mode); + if (TYPE_PRECISION (type) <= GET_MODE_PRECISION (limb_mode)) { SET_TYPE_MODE (type, limb_mode); - gcc_assert (info.abi_limb_mode == info.limb_mode); cnt = 1; } else { SET_TYPE_MODE (type, BLKmode); cnt = CEIL (TYPE_PRECISION (type), GET_MODE_PRECISION (limb_mode)); - gcc_assert (info.abi_limb_mode == info.limb_mode - || !info.big_endian == !WORDS_BIG_ENDIAN); } TYPE_SIZE (type) = bitsize_int (cnt * GET_MODE_BITSIZE (limb_mode)); TYPE_SIZE_UNIT (type) = size_int (cnt * GET_MODE_SIZE (limb_mode)); -- 2.46.0