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

--- Comment #14 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Matthias Kretz
<[email protected]>:

https://gcc.gnu.org/g:7ebe0af619c317969346b7c612198776c2f89cc8

commit r16-9595-g7ebe0af619c317969346b7c612198776c2f89cc8
Author: Matthias Kretz <[email protected]>
Date:   Mon Aug 17 15:44:35 2026 +0200

    libstdc++: Resolve integer type mismatches in stdx::simd [PR122981]

    Conversions from generic vector to ARM vector are rejected when the
    value type is not equal. Since arm-none-eabi defines int32_t as long
    rather than int, a generic int vector passed as int32x2_t argument is
    ill-formed.

    With this patch, use the intN_t aliases in general: for the central
    __int_for_sizeof meta function and when bitcasting vectors in the NEON
    popcount implementation.

    This solution avoids unnecessary reinterpretation of generic vectors as
    ARM vectors, keeping it a tiny bit more type safe.

    libstdc++-v3/ChangeLog:

            PR libstdc++/122981
            * include/experimental/bits/simd.h (__int_for_sizeof): Return
            int32_t, int8_t, int16_t, and int64_t, rather than int, signed
            char, short, long, and long long.
            * include/experimental/bits/simd_neon.h (_S_popcount): Cast
            elements to int8_t, int16_t, int32_t, or int64_t, rather than
            signed char, short, int, or long.

    Signed-off-by: Matthias Kretz <[email protected]>
    (cherry picked from commit 4e08734e5fcfba5fb657a163a20c001236655f01)

Reply via email to