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

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

https://gcc.gnu.org/g:1553e4094207cfe87e98980752a88a49e1b6626d

commit r14-10872-g1553e4094207cfe87e98980752a88a49e1b6626d
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Thu Oct 31 10:52:56 2024 +0100

    expand: Fix up expansion of VIEW_CONVERT_EXPR to BITINT_TYPE [PR117354]

    The following testcase ICEs, because when trying to expand the
    VIEW_CONVERT_EXPR operand which is SSA_NAME defined to
    V32QI or V4DI MEM_REF which is aligned just to 8 bytes we force
    it as unaligned into a register, but then try to call extract_bit_field
    from the V32QI or V4DI register to BLKmode.  extract_bit_field doesn't
    obviously support BLKmode extraction and so ICEs.

    The second hunk fixes the ICE by not calling extract_bit_field when
    it can't handle it, the last if will handle it properly by storing
    it to memory and using BLKmode access to the copy.

    The first hunk is an optimization, if mode is BLKmode, by setting
    inner_reference_p argument to expand_expr_real we avoid the
    expand_misaligned_mem_ref calls which load it from memory into a register.

    2024-10-31  Jakub Jelinek  <ja...@redhat.com>

            PR middle-end/117354
            * expr.cc (expand_expr_real_1) <case VIEW_CONVERT_EXPR>: Pass
            true as inner_reference_p argument to expand_expr_real if
            mode is BLKmode.  Don't call extract_bit_field if mode is BLKmode.

            * gcc.dg/bitint-113.c: New test.

    (cherry picked from commit b39f62ff739e9ffea0e6485667f15b985f8cd63d)

Reply via email to