public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/102633] New: warning for self-initialization despite -Wno-init-self Date: Wed, 06 Oct 2021 21:40:45 +0000 [thread overview] Message-ID: <bug-102633-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102633 Bug ID: 102633 Summary: warning for self-initialization despite -Wno-init-self Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- GCC issues -Wuninitialized for cv-qualified variables initialized with themselves even when -Wno-init-self is in effect. $ cat x.c && gcc -O2 -S -Wall -Wno-init-self -xc++ x.c int f (void) { int i = i; // no warning (good) return i; } int g (void) { const int i = i; // -Wuninitialized (bug) return i; } int h (void) { volatile int i = i; // -Wuninitialized (bug) return i; } x.c: In function ‘int g()’: x.c:9:13: warning: ‘i’ is used uninitialized [-Wuninitialized] 9 | const int i = i; // -Wuninitialized (bug) | ^ x.c:9:13: note: ‘i’ was declared here 9 | const int i = i; // -Wuninitialized (bug) | ^ x.c: In function ‘int h()’: x.c:15:20: warning: ‘i’ is used uninitialized [-Wuninitialized] 15 | volatile int i = i; // -Wuninitialized (bug) | ^ x.c:15:16: note: ‘i’ declared here 15 | volatile int i = i; // -Wuninitialized (bug) | ^
next reply other threads:[~2021-10-06 21:40 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-10-06 21:40 msebor at gcc dot gnu.org [this message] 2021-10-06 21:42 ` [Bug middle-end/102633] [11/12 Regression] " msebor at gcc dot gnu.org 2021-10-06 21:47 ` msebor at gcc dot gnu.org 2021-10-07 9:02 ` rguenth at gcc dot gnu.org 2022-04-21 7:50 ` rguenth at gcc dot gnu.org 2022-07-26 13:25 ` [Bug middle-end/102633] [11/12/13 " rguenth at gcc dot gnu.org 2022-07-26 14:09 ` mpolacek at gcc dot gnu.org 2022-07-26 14:28 ` mpolacek at gcc dot gnu.org 2022-07-27 6:11 ` muecker at gwdg dot de 2022-08-11 14:29 ` cvs-commit at gcc dot gnu.org 2022-08-11 14:30 ` [Bug middle-end/102633] [11/12 " mpolacek at gcc dot gnu.org 2023-02-10 15:16 ` mpolacek at gcc dot gnu.org 2023-02-10 17:47 ` cvs-commit at gcc dot gnu.org 2023-02-10 17:55 ` jakub at gcc dot gnu.org 2023-02-22 16:10 ` [Bug middle-end/102633] [11 " mpolacek 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-102633-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: 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).