public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/107793] New: trivial-auto-var-init=pattern invalid uninitialized variable warning
@ 2022-11-21 13:04 larsbj at gullik dot net
  2022-11-21 15:35 ` [Bug middle-end/107793] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: larsbj at gullik dot net @ 2022-11-21 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107793
           Summary: trivial-auto-var-init=pattern invalid uninitialized
                    variable warning
           Product: gcc
           Version: 12.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: larsbj at gullik dot net
  Target Milestone: ---

Created attachment 53936
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53936&action=edit
Preprocessed source

This is most likely the same as Bug 107411, but with =pattern instead of =zero
and with GCC 12.2.1.

The preprocessed code has been reduced from production code with cvise.

g++ -v -Werror=uninitialized -Wno-return-type -std=gnu++20
-ftrivial-auto-var-init=pattern -c test.cpp.ii
Using built-in specs.
COLLECT_GCC=/usr/bin/g++
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap
--enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared
--enable-threads=posix --enable-checking=release --enable-multilib
--with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-gcc-major-version-only --enable-libstdcxx-backtrace
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array
--with-isl=/builddir/build/BUILD/gcc-12.2.1-20220819/obj-x86_64-redhat-linux/isl-install
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-offload-defaulted --enable-gnu-indirect-function --enable-cet
--with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
--with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.1 20220819 (Red Hat 12.2.1-2) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-Werror=uninitialized' '-Wno-return-type'
'-std=gnu++20' '-ftrivial-auto-var-init=pattern' '-c' '-o' 'test.cpp.o'
'-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/libexec/gcc/x86_64-redhat-linux/12/cc1plus -fpreprocessed test.cpp.ii
-quiet -dumpbase test.cpp.ii -dumpbase-ext .ii -mtune=generic -march=x86-64
-Werror=uninitialized -Wno-return-type -std=gnu++20 -version
-ftrivial-auto-var-init=pattern -o /tmp/ccWKm8Nk.s
GNU C++20 (GCC) version 12.2.1 20220819 (Red Hat 12.2.1-2)
(x86_64-redhat-linux)
        compiled by GNU C version 12.2.1 20220819 (Red Hat 12.2.1-2), GMP
version 6.2.1, MPFR version 4.1.0-p13, MPC version 1.2.1, isl version
isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++20 (GCC) version 12.2.1 20220819 (Red Hat 12.2.1-2)
(x86_64-redhat-linux)
        compiled by GNU C version 12.2.1 20220819 (Red Hat 12.2.1-2), GMP
version 6.2.1, MPFR version 4.1.0-p13, MPC version 1.2.1, isl version
isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 9f5f4abeaa560d9a1c5632825fca686f
test.cpp.ii: In function ‘int make_arg(T) [with int <anonymous> = 0;
<template-parameter-1-2> = int; int <anonymous> = 0; T = int]’:
test.cpp.ii:16:15: error: ‘D.2668’ is used uninitialized
[-Werror=uninitialized]
   16 |   const auto &arg = arg_mapper().map(val);
      |               ^~~
cc1plus: some warnings being treated as errors

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

* [Bug middle-end/107793] trivial-auto-var-init=pattern invalid uninitialized variable warning
  2022-11-21 13:04 [Bug middle-end/107793] New: trivial-auto-var-init=pattern invalid uninitialized variable warning larsbj at gullik dot net
@ 2022-11-21 15:35 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-21 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Lars Gullik Bjønnes from comment #0)
> Created attachment 53936 [details]
> Preprocessed source
> 
> This is most likely the same as Bug 107411, but with =pattern instead of
> =zero and with GCC 12.2.1.

Yes it is the same issue in the end (added -fno-exceptions but the only
difference there is argmaper::map ends the basic block):
  _1 = .DEFERRED_INIT (4, 1, &"D.3055"[0]);
  D.3055 = _1;
  arg_7 = .DEFERRED_INIT (8, 1, &"arg"[0]);
  _2 = (char) val_8(D);
  _3 = (int) _2;
  _4 = arg_mapper::map (&D.3053, _3);
  D.3055 = _4;
  arg_11 = &D.3055;

The IR are basically the same here even.

*** This bug has been marked as a duplicate of bug 107411 ***

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

end of thread, other threads:[~2022-11-21 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 13:04 [Bug middle-end/107793] New: trivial-auto-var-init=pattern invalid uninitialized variable warning larsbj at gullik dot net
2022-11-21 15:35 ` [Bug middle-end/107793] " pinskia at gcc dot gnu.org

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).