public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "tromey at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/45085] New: incorrect -Wuninitialized warning Date: Mon, 26 Jul 2010 16:11:00 -0000 [thread overview] Message-ID: <bug-45085-360@http.gcc.gnu.org/bugzilla/> (raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 1812 bytes --] I'm using a relatively recent svn trunk gcc on an x86 Fedora 13 machine. I'm trying to compile gdb with it. I got this error: ../../archer/gdb/remote.c: In function remote_wait: ../../archer/gdb/remote.c:5561:10: error: event_ptid.tid may be used uninitialized in this function [-Werror=uninitialized] ../../archer/gdb/remote.c:5561:10: error: event_ptid.lwp may be used uninitialized in this function [-Werror=uninitialized] ../../archer/gdb/remote.c:5561:10: error: event_ptid.pid may be used uninitialized in this function [-Werror=uninitialized] cc1: all warnings being treated as errors But the body of remote_wait is simple: { ptid_t event_ptid; if (non_stop) event_ptid = remote_wait_ns (ptid, status, options); else event_ptid = remote_wait_as (ptid, status, options); if (target_can_async_p ()) { /* If there are are events left in the queue tell the event loop to return here. */ if (stop_reply_queue) mark_async_event_handler (remote_async_inferior_event_token); } return event_ptid; } I thought perhaps that inlining was causing a problem (in which case this error message is quite confusing, since it would point to the wrong function). However, I added this: memset (&event_ptid, 0, sizeof (event_ptid)); ... to the function before the "if", and the error went away. So, I think this is a gcc bug. I will attach the .i file. -- Summary: incorrect -Wuninitialized warning Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tromey at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45085
next reply other threads:[~2010-07-26 16:11 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-07-26 16:11 tromey at gcc dot gnu dot org [this message] 2010-07-26 16:13 ` [Bug tree-optimization/45085] " tromey at gcc dot gnu dot org 2010-07-27 12:42 ` jakub at gcc dot gnu dot org 2010-07-27 12:58 ` jakub at gcc dot gnu dot org 2010-07-27 13:25 ` [Bug tree-optimization/45085] [4.6 Regression] " jakub at gcc dot gnu dot org 2010-07-27 14:13 ` hubicka at gcc dot gnu dot org 2010-08-03 12:09 ` hubicka at gcc dot gnu dot org 2010-09-02 11:11 ` rguenth at gcc dot gnu dot org 2010-09-02 22:59 ` manu at gcc dot gnu dot org 2010-09-03 9:11 ` jakub at gcc dot gnu dot 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-45085-360@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: linkBe 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).