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

--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:5eecb51ad72058746b6e2b0842f0bba544d073e4

commit r16-7936-g5eecb51ad72058746b6e2b0842f0bba544d073e4
Author: Andrew Pinski <[email protected]>
Date:   Tue Feb 17 14:03:44 2026 -0800

    aarch64: Fix uint64_t[8] usage after including "arm_neon.h" [PR124126]

    aarch64_init_ls64_builtins_types currently creates an array with type
uint64_t[8]
    and then sets the mode to V8DI. The problem here is if you used that array
    type before, you would get a mode of BLK.
    This causes an ICE in some cases, with the C++ front-end with -g, you would
    get "type variant differs by TYPE_MODE" and in some cases even without -g,
    "canonical types differ for identical types".

    The fix is to do build_distinct_type_copy of the array in
aarch64_init_ls64_builtins_types
    before assigning the mode to that copy. We keep the same ls64 structures
correct and
    user provided arrays are not influenced when "arm_neon.h" is included.

    Build and tested on aarch64-linux-gnu.

            PR target/124126

    gcc/ChangeLog:

            * config/aarch64/aarch64-builtins.cc
(aarch64_init_ls64_builtins_types): Copy
            the array type before setting the mode.

    gcc/testsuite/ChangeLog:

            * g++.target/aarch64/pr124126-1.C: New test.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to