[Bug libstdc++/122981] pr109261_constexpr_simd.cc and pr115454_find_last_set.cc fail on arm-none-eabi

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122981

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

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

commit r17-3369-g4e08734e5fcfba5fb657a163a20c001236655f01
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]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.