[Bug other/105593] New: avx512 math function raises uninitialized variable warning

rogerio.souza at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri May 13 14:35:19 GMT 2022


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

            Bug ID: 105593
           Summary: avx512 math function raises uninitialized variable
                    warning
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rogerio.souza at gmail dot com
  Target Milestone: ---

When using avx512 math function we got the following warning:

/<gcc_path>/lib/gcc/x86_64-redhat-linux/12.1.0/include/avx512fintrin.h:6994:10:
error: '__Y' may be used uninitialized [-Werror=maybe-uninitialized]

The code that triggers the error is the one below, from file avx512fintrin.h:

  202 extern __inline __m512i
  203 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  204 _mm512_undefined_epi32 (void)
  205 {
  206   __m512i __Y = __Y; // Uninitialized variable "__Y"
  207   return __Y;
  208 }

Should this code be reviewed?

Using "-Wno-uninitialized" prevents this warning from happening.


More information about the Gcc-bugs mailing list