https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121131

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
r14-2224 added (admittedly before _BitInt support went in):
          /* Integral bit-fields are left-justified on big-endian targets, so
             we must arrange for native_encode_int to start at their MSB.  */
          if (DECL_BIT_FIELD (cfield) && INTEGRAL_TYPE_P (TREE_TYPE (cfield)))
            {
              if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN)
                return NULL_TREE;
              const unsigned int encoding_size
                = GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE (cfield)));
              if (BYTES_BIG_ENDIAN)
                inner_offset += encoding_size - wi::to_offset (field_size);
            }

This obviously doesn't work with BLKmode BITINT_TYPEs.  Now, GCC 14/15 don't
support
_BitInt on any big endian targets, so for backports the fix could be as well as
          if (DECL_BIT_FIELD (cfield) && INTEGRAL_TYPE_P (TREE_TYPE (cfield)))
            {
              if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN)
                return NULL_TREE;
              if (BYTES_BIG_ENDIAN)
                {
                  const unsigned int encoding_size
                    = GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (TREE_TYPE
(cfield)));
                  inner_offset += encoding_size - wi::to_offset (field_size);
                }
            }
GCC 16 has support for big-endian _BitInt but no target with it enabled yet
(dunno what is blocking s390x).

Reply via email to