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/97840] [11 regression] Bogus -Wmaybe-uninitialized Date: Mon, 16 Nov 2020 01:22:40 +0000 [thread overview] Message-ID: <bug-97840-4-yq9p1Q5UMM@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-97840-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97840 --- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> --- The warning code considers more that just TYPE_EMPTY_P(): /* Avoid warning about empty types such as structs with no members. The first_field() test is important for C++ where the predicate alone isn't always sufficient. */ tree rhstype = TREE_TYPE (rhs); if (POINTER_TYPE_P (rhstype)) rhstype = TREE_TYPE (rhstype); if (TYPE_EMPTY_P (rhstype) || (RECORD_OR_UNION_TYPE_P (rhstype) && (!first_field (rhstype) || default_is_empty_record (rhstype)))) return NULL_TREE; If the struct has no data members the warning shouldn't trigger even if TYPE_EMPTY_P() is false. I don't think std::allocator has data members so we need to see why the check isn't good enough. Ah, it looks like the whole condition is false because default_is_empty_record (rhstype) is false, which is because TREE_ADDRESSABLE (rhstype) is true. Is that what has changed with your patch? Either way, I do agree that the warning shouldn't be sensitve to ABI nuances so perhaps default_is_empty_type() (rhstype) would be a better API to use here (except it's static). Let me look into that.
next prev parent reply other threads:[~2020-11-16 1:22 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-11-15 16:14 [Bug middle-end/97840] New: " schwab@linux-m68k.org 2020-11-15 17:15 ` [Bug middle-end/97840] " hubicka at gcc dot gnu.org 2020-11-15 17:31 ` hubicka at gcc dot gnu.org 2020-11-15 17:57 ` hubicka at gcc dot gnu.org 2020-11-15 18:03 ` hubicka at gcc dot gnu.org 2020-11-16 1:22 ` msebor at gcc dot gnu.org [this message] 2020-11-16 7:27 ` rguenth at gcc dot gnu.org 2020-11-16 7:34 ` hubicka at gcc dot gnu.org 2020-11-16 15:32 ` cvs-commit at gcc dot gnu.org 2020-11-16 16:43 ` schwab@linux-m68k.org 2020-11-16 18:18 ` hubicka at gcc dot gnu.org 2020-11-16 20:11 ` jakub at gcc dot gnu.org 2020-11-16 20:18 ` Jan Hubicka 2020-11-16 20:18 ` hubicka at ucw dot cz 2020-11-16 20:30 ` jakub at gcc dot gnu.org 2020-11-16 20:37 ` Jan Hubicka 2020-11-16 20:37 ` hubicka at ucw dot cz 2020-11-16 21:54 ` msebor at gcc dot gnu.org 2020-11-16 22:01 ` Jan Hubicka 2020-11-16 22:01 ` hubicka at ucw dot cz 2020-11-17 3:02 ` cvs-commit at gcc dot gnu.org 2020-11-24 0:35 ` 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-97840-4-yq9p1Q5UMM@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).