From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B234385828E; Sat, 2 Dec 2023 12:31:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B234385828E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701520277; bh=tizHdlFro4jy/EtN8Xmas98tWhu/X4MJQBfVhjoDBm4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Rxw8zAE90GZ205RgUkfLe2CFs49BieCt++nMKVU4Gv4FEi8Hcr5xooZFsoolYbq++ qnglsSw/KbAfkt0CVOLTifEicqLB2s2JCqrO68VnKyBoEF2e9abNiRzBmOOgCLdUMe Jb7n9TIK+k5ZobJOODEs8zuyRaAPDN9Bj+C6OYxc= From: "nathanieloshead at gmail dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: link-failure X-Bugzilla-Severity: normal X-Bugzilla-Who: nathanieloshead at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112820 Nathaniel Shead changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nathanieloshead at gmail d= ot com --- Comment #1 from Nathaniel Shead --- 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 actua= lly 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 =3D=3D that was a lie, it is here */ - bool is_external =3D t->decl_common.decl_flag_1; + bool is_external =3D code !=3D TYPE_DECL && t->decl_common.decl_fla= g_1; if (!is_external) /* decl_flag_1 is DECL_EXTERNAL. Things we emit here, might well be external from the POV of an importer. */=