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

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

https://gcc.gnu.org/g:4e59197dddc31acbcfdc7c792ed2cfdc0763dee5

commit r17-7182-g4e59197dddc31acbcfdc7c792ed2cfdc0763dee5
Author: Jakub Jelinek <[email protected]>
Date:   Fri Dec 4 15:46:47 2026 +0100

    internal-fn: Fix up builtin-bitexpandg-1.c on powerpc64 big endian
[PR129228]

    The c-c++-common/builtin-bitexpandg-1.c test FAILs on powerpc64-linux
    big-endian (both -m32/-m64).
    assign_stack_temp -> assign_stack_temp_for_type -> assign_stack_local_2
    does some weird bigendian_correction when expand_BITEXPAND asks e.g. for
    assign_stack_temp (DImode, 6 * GET_MODE_SIZE (DImode))
    and the test then overflows the stack because it is writing into wrong
    buffer.
    Fixed by creating an array type of log2_prec1 elements with some
    INTEGER_TYPE with TYPE_MODE wmode, and using assign_stack_temp_for_type
    with TYPE_MODE of the ARRAY_TYPE, int_size_in_bytes and the ARRAY_TYPE
    itself.  No big-endian correction is performed then when TYPE_MODE
    is likely BLKmode, or even if it is some other mode it is the mode of
    the whole array rather than just one element.

    2026-12-04  Jakub Jelinek  <[email protected]>

            PR middle-end/129228
            PR middle-end/129134
            * internal-fn.cc (expand_BITEXPAND): Create array of
            log2_prec1 type_for_mode (wmode, 1) elements.  Call
            assign_stack_temp_for_type instead of assign_stack_temp,
            with TYPE_MODE of that array type, its size and the type
            itself.

    Reviewed-by: Jeff Law <[email protected]>

Reply via email to