public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/98373] New: [11 Repression] Bogus error: ‘symbuf’ may be used uninitialized at -O0
@ 2020-12-18 13:16 hjl.tools at gmail dot com
  2020-12-18 15:36 ` [Bug middle-end/98373] " msebor at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2020-12-18 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98373
           Summary: [11 Repression] Bogus error: ‘symbuf’ may be used
                    uninitialized at -O0
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
  Target Milestone: ---

Created attachment 49795
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49795&action=edit
A testcase

[hjl@gnu-cfl-2 gold]$ /usr/gcc-11.0.0-x32/bin/g++ -S /tmp/plugin.ii -W -Wall
/export/linux/src/binutils/binutils/gold/plugin.cc: In member function ‘void
gold::Sized_pluginobj<size, big_endian>::do_add_symbols(gold::Symbol_table*,
gold::Read_symbols_data*, gold::Layout*) [with int size = 32; bool big_endian =
false]’:
/export/linux/src/binutils/binutils/gold/plugin.cc:1400:33: warning: ‘symbuf’
may be used uninitialized [-Wmaybe-uninitialized]
 1400 |   elfcpp::Sym<size, big_endian> sym(symbuf);
      |                                 ^~~
In file included from /export/linux/src/binutils/binutils/gold/script.h:37,
                 from /export/linux/src/binutils/binutils/gold/layout.h:33,
                 from /export/linux/src/binutils/binutils/gold/plugin.cc:73:
/export/linux/src/binutils/binutils/gold/../elfcpp/elfcpp.h:1532:3: note: by
argument 2 of type ‘const unsigned char*’ to ‘elfcpp::Sym<size,
big_endian>::Sym(const unsigned char*) [with int size = 32; bool big_endian =
false]’ declared here
 1532 |   Sym(const unsigned char* p)
      |   ^~~
/export/linux/src/binutils/binutils/gold/plugin.cc:1399:17: note: ‘symbuf’
declared here
 1399 |   unsigned char symbuf[sym_size];
      |                 ^~~~~~
/export/linux/src/binutils/binutils/gold/plugin.cc: In member function ‘void
gold::Sized_pluginobj<size, big_endian>::do_add_symbols(gold::Symbol_table*,
gold::Read_symbols_data*, gold::Layout*) [with int size = 64; bool big_endian =
false]’:
/export/linux/src/binutils/binutils/gold/plugin.cc:1400:33: warning: ‘symbuf’
may be used uninitialized [-Wmaybe-uninitialized]
 1400 |   elfcpp::Sym<size, big_endian> sym(symbuf);
      |                                 ^~~
In file included from /export/linux/src/binutils/binutils/gold/script.h:37,
                 from /export/linux/src/binutils/binutils/gold/layout.h:33,
                 from /export/linux/src/binutils/binutils/gold/plugin.cc:73:
/export/linux/src/binutils/binutils/gold/../elfcpp/elfcpp.h:1532:3: note: by
argument 2 of type ‘const unsigned char*’ to ‘elfcpp::Sym<size,
big_endian>::Sym(const unsigned char*) [with int size = 64; bool big_endian =
false]’ declared here
 1532 |   Sym(const unsigned char* p)
      |   ^~~
/export/linux/src/binutils/binutils/gold/plugin.cc:1399:17: note: ‘symbuf’
declared here
 1399 |   unsigned char symbuf[sym_size];
      |                 ^~~~~~
[hjl@gnu-cfl-2 gold]$ /usr/gcc-11.0.0-x32/bin/g++ -S /tmp/plugin.ii -W -Wall
-O2
[hjl@gnu-cfl-2 gold]$

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

end of thread, other threads:[~2020-12-18 23:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 13:16 [Bug middle-end/98373] New: [11 Repression] Bogus error: ‘symbuf’ may be used uninitialized at -O0 hjl.tools at gmail dot com
2020-12-18 15:36 ` [Bug middle-end/98373] " msebor at gcc dot gnu.org
2020-12-18 21:55 ` hjl.tools at gmail dot com
2020-12-18 22:38 ` [Bug middle-end/98373] [11 Repression] Bogus error: ‘symbuf’ may be used uninitialized at -O0 by r11-959 hjl.tools at gmail dot com
2020-12-18 23:40 ` msebor 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).