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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:0613b12dd7f6274a1aac07f295ed51d86c2c85f1

commit r14-9447-g0613b12dd7f6274a1aac07f295ed51d86c2c85f1
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Mar 13 10:19:04 2024 +0100

    bitint: Fix up lowering of bitfield loads/stores [PR114313]

    The following testcase ICEs, because for large/huge _BitInt bitfield
    loads/stores we use the DECL_BIT_FIELD_REPRESENTATIVE as the underlying
    "var" and indexes into it can be larger than the precision of the
    bitfield might normally allow.

    The following patch fixes that by passing NULL_TREE type in that case
    to limb_access, so that we always return m_limb_type type and don't
    do the extra assertions, after all, the callers expect that too.
    I had to add the first hunk to avoid ICE, it was using type in one place
    even when it was NULL.  But TYPE_SIZE (TREE_TYPE (var)) seems like the
    right size to use anyway because the code uses VIEW_CONVERT_EXPR on it.

    2024-03-13  Jakub Jelinek  <ja...@redhat.com>

            PR middle-end/114313
            * gimple-lower-bitint.cc (bitint_large_huge::limb_access): Use
            TYPE_SIZE of TREE_TYPE (var) rather than TYPE_SIZE of type.
            (bitint_large_huge::handle_load): Pass NULL_TREE rather than
            rhs_type to limb_access for the bitfield load cases.
            (bitint_large_huge::lower_mergeable_stmt): Pass NULL_TREE rather
than
            lhs_type to limb_access if nlhs is non-NULL.

            * gcc.dg/torture/bitint-62.c: New test.

Reply via email to