public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "nathanieloshead at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/112820] vtable not emitted correctly from module when compiling with -g
Date: Sat, 02 Dec 2023 12:31:16 +0000	[thread overview]
Message-ID: <bug-112820-4-9Jd208z7MH@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-112820-4@http.gcc.gnu.org/bugzilla/>

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

Nathaniel Shead <nathanieloshead at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nathanieloshead at gmail dot com

--- Comment #1 from Nathaniel Shead <nathanieloshead at gmail dot com> ---
The issue seems to be that the same flag is used for DECL_EXTERN and
TYPE_DECL_SUPPRESS_DEBUG, and the modules reading code is getting confused and
thinking that TYPE_DECLs with the latter flag set means that they are actually
DECL_EXTERN and thus preventing them from being emitted.

The following hunk fixes this issue but it'd probably be better to clean up all
handling of extern within the modules reading so that we don't lose the
"suppress debug" flag entirely.

diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 33fcf396875..add3fa4b945 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -5397,7 +5397,7 @@ trees_out::core_bools (tree t)
           DECL_NOT_REALLY_EXTERN -> base.not_really_extern
             == that was a lie, it is here  */

-       bool is_external = t->decl_common.decl_flag_1;
+       bool is_external = code != TYPE_DECL && t->decl_common.decl_flag_1;
        if (!is_external)
          /* decl_flag_1 is DECL_EXTERNAL. Things we emit here, might
             well be external from the POV of an importer.  */

  reply	other threads:[~2023-12-02 12:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-02  1:38 [Bug c++/112820] New: " michael.kenzel at gmail dot com
2023-12-02 12:31 ` nathanieloshead at gmail dot com [this message]
2023-12-04  7:00 ` [Bug c++/112820] " rguenth at gcc dot gnu.org
2024-01-23  9:46 ` cvs-commit at gcc dot gnu.org
2024-01-27 10:26 ` nshead 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-112820-4-9Jd208z7MH@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).