[Bug c++/105593] avx512 math function raises uninitialized variable warning

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 16 08:42:10 GMT 2023


--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:


commit r13-5186-g6b0907b4fc455377e5f8109f427d97da02b6aec9
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Jan 16 09:41:38 2023 +0100

    x86: Avoid -Wuninitialized warnings on _mm*_undefined_* in C++ [PR105593]

    In https://gcc.gnu.org/pipermail/gcc-patches/2023-January/609844.html
    I've posted a patch to allow ignoring -Winit-self using GCC diagnostic
    pragmas, such that one can mark self-initialization as intentional
    disabling of -Wuninitialized warnings.

    The following incremental patch uses that in the x86 intrinsic

    2023-01-16  Jakub Jelinek  <jakub@redhat.com>

            PR c++/105593
            * config/i386/xmmintrin.h (_mm_undefined_ps): Temporarily
            disable -Winit-self using pragma GCC diagnostic ignored.
            * config/i386/emmintrin.h (_mm_undefined_pd, _mm_undefined_si128):
            * config/i386/avxintrin.h (_mm256_undefined_pd,
            _mm256_undefined_si256): Likewise.
            * config/i386/avx512fintrin.h (_mm512_undefined_pd,
            _mm512_undefined_ps, _mm512_undefined_epi32): Likewise.
            * config/i386/avx512fp16intrin.h (_mm_undefined_ph,
            _mm256_undefined_ph, _mm512_undefined_ph): Likewise.
            * g++.target/i386/pr105593.C: New test.

More information about the Gcc-bugs mailing list