public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/98373] New: [11 Repression] Bogus error: ‘symbuf’ may be used uninitialized at -O0
Date: Fri, 18 Dec 2020 13:16:14 +0000	[thread overview]
Message-ID: <bug-98373-4@http.gcc.gnu.org/bugzilla/> (raw)

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]$

             reply	other threads:[~2020-12-18 13:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-18 13:16 hjl.tools at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98373-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).