public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* avx512erintrin.h: uninitialized variable warning (optimized build)
@ 2023-01-12  0:26 James Addison
  2023-01-12  6:51 ` Sam James
  0 siblings, 1 reply; 3+ messages in thread
From: James Addison @ 2023-01-12  0:26 UTC (permalink / raw)
  To: gcc

Hi,

During GCC 12.2.0 compilation of a file that includes[1] immintrin.h
with both code-optimization and uninitialized-variable-warnings
enabled, a warning is emitted:

    /usr/lib/gcc/x86_64-linux-gnu/12/include/avx512erintrin.h:55:20:
warning: ‘__W’ is used uninitialized [-Wuninitialized]

The minimal repro compilation command appears to be:

    gcc -O -Wuninitialized -mavx512er -mavx512pf
./numpy/distutils/checks/cpu_avx512_knl.c

My question is: does the warning indicate a possible bug that should
be reported, or is there a reason that the relevant code[2] does not
initialize the variable (for example, for performance reasons)?

Thank you,
James

[1] - https://github.com/numpy/numpy/blob/bb2769e12a8646f3d63097e9464592aa6e20058d/numpy/distutils/checks/cpu_avx512_knl.c#L14

[2] - https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/config/i386/avx512erintrin.h;h=6b3b679a17675612f45a1090f227012b80b871a6#l54

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: avx512erintrin.h: uninitialized variable warning (optimized build)
  2023-01-12  0:26 avx512erintrin.h: uninitialized variable warning (optimized build) James Addison
@ 2023-01-12  6:51 ` Sam James
  2023-01-12 11:30   ` James Addison
  0 siblings, 1 reply; 3+ messages in thread
From: Sam James @ 2023-01-12  6:51 UTC (permalink / raw)
  To: James Addison; +Cc: gcc

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]



> On 12 Jan 2023, at 00:26, James Addison via Gcc <gcc@gcc.gnu.org> wrote:
> 
> Hi,
> 
> During GCC 12.2.0 compilation of a file that includes[1] immintrin.h
> with both code-optimization and uninitialized-variable-warnings
> enabled, a warning is emitted:
> 
>    /usr/lib/gcc/x86_64-linux-gnu/12/include/avx512erintrin.h:55:20:
> warning: ‘__W’ is used uninitialized [-Wuninitialized]
> 
> The minimal repro compilation command appears to be:
> 
>    gcc -O -Wuninitialized -mavx512er -mavx512pf
> ./numpy/distutils/checks/cpu_avx512_knl.c
> 
> My question is: does the warning indicate a possible bug that should
> be reported, or is there a reason that the relevant code[2] does not
> initialize the variable (for example, for performance reasons)?

See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593, might
be the same thing?

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 358 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: avx512erintrin.h: uninitialized variable warning (optimized build)
  2023-01-12  6:51 ` Sam James
@ 2023-01-12 11:30   ` James Addison
  0 siblings, 0 replies; 3+ messages in thread
From: James Addison @ 2023-01-12 11:30 UTC (permalink / raw)
  To: Sam James; +Cc: gcc

Thanks, Sam,

Yep, that does seem closely related.  The problems mentioned there
look similar enough that it may be possible to resolve an entire class
of these problems in the same area of the code in a single pass.  I'll
add some more details there soon.

On Thu, 12 Jan 2023 at 06:51, Sam James <sam@gentoo.org> wrote:
>
>
>
> > On 12 Jan 2023, at 00:26, James Addison via Gcc <gcc@gcc.gnu.org> wrote:
> >
> > Hi,
> >
> > During GCC 12.2.0 compilation of a file that includes[1] immintrin.h
> > with both code-optimization and uninitialized-variable-warnings
> > enabled, a warning is emitted:
> >
> >    /usr/lib/gcc/x86_64-linux-gnu/12/include/avx512erintrin.h:55:20:
> > warning: ‘__W’ is used uninitialized [-Wuninitialized]
> >
> > The minimal repro compilation command appears to be:
> >
> >    gcc -O -Wuninitialized -mavx512er -mavx512pf
> > ./numpy/distutils/checks/cpu_avx512_knl.c
> >
> > My question is: does the warning indicate a possible bug that should
> > be reported, or is there a reason that the relevant code[2] does not
> > initialize the variable (for example, for performance reasons)?
>
> See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105593, might
> be the same thing?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-12 11:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12  0:26 avx512erintrin.h: uninitialized variable warning (optimized build) James Addison
2023-01-12  6:51 ` Sam James
2023-01-12 11:30   ` James Addison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).