On Tue, May 20, 2025 at 11:29:11AM +0800, Yang Yujie wrote:
> gcc/ChangeLog:
>
> * stor-layout.cc (layout_type): Allow limb_mode to be DImode
> while abi_limb_mode is TImode for _BitInt(N), N > 64.
> ---
> gcc/stor-layout.cc | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gcc/stor-layout.cc b/gcc/stor-layout.cc
> index 18b5af56124..75997f531c1 100644
> --- a/gcc/stor-layout.cc
> +++ b/gcc/stor-layout.cc
> @@ -2480,7 +2480,8 @@ layout_type (tree type)
> if (TYPE_PRECISION (type) <= GET_MODE_PRECISION (limb_mode))
> {
> SET_TYPE_MODE (type, limb_mode);
> - gcc_assert (info.abi_limb_mode == info.limb_mode);
> + gcc_assert (info.abi_limb_mode == info.limb_mode
> + || !info.big_endian == !WORDS_BIG_ENDIAN);
> cnt = 1;
> }
> else
Why do you need this?
The assert isn't for your N > 64 case, but for the N <= 64 one.
And wants to ensure that for those cases (i.e. where there is exactly
one limb) both modes are the same.
>From what I can see, you only change abi_limb_mode for n > 64 in
your backend.
Jakub