From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C58E385B833; Fri, 3 Apr 2020 13:03:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C58E385B833 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585919034; bh=XeeXctHcjV7gHCQnktZfGNkWjwm5RoiQqtpXwVy7cDg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jKeJ1fT5koWkwdw9EXpS3sOzpZVS8T4LTpTcyj8VMRcYql44/OvK9dWvK6/78/r68 ivQWvXgXuAUOJ05Fy7tPxWlmiiX+f5x3PY3Tcqfgi3x0cJKmONN69l+80WbLHzb3u/ xLLbJ1mGkY48qSxV8wGE8iNvRlbTs0SmM+ciwMGQ= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/94450] lto abstract variable emitted as concrete decl Date: Fri, 03 Apr 2020 13:03:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: lto X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW 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: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Apr 2020 13:03:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94450 --- Comment #11 from rguenther at suse dot de --- On Fri, 3 Apr 2020, vries at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94450 >=20 > --- Comment #10 from Tom de Vries --- > (In reply to rguenther@suse.de from comment #9) > > On Fri, 3 Apr 2020, vries at gcc dot gnu.org wrote: > >=20 > > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94450 > > >=20 > > > --- Comment #8 from Tom de Vries --- > > > (In reply to Richard Biener from comment #7) > > > > The DW_TAG_imported_unit are now gone for GCC 10. So can we consid= er this > > > > fixed? > > >=20 > > > I'd like a PR to refer to at the to-be-added xfail in the gdb test-ca= se (and > > > the PR should be open as long as that test fails with trunk gcc). It = doesn't > > > matter for me whether that's this particular PR or a follow-up PR. > >=20 > > OK, so if you have a (single?) specific testcase that's still affected > > please duplicate that into a new bugzilla. It's always better to > > have something specific to track. > >=20 > > So did the patch not change anything? >=20 > Well, the changes I asked for related to the example in comment 0 are: > - drop the import > - change the tag from DW_TAG_compile_unit to DW_TAG_partial unit. >=20 > AFAIU the patch only removes the import, so in that sense I do not consid= er the > test-case reported in comment 0 addressed. OK, fair enough. Note that as I read the DWARF spec changing the early CUs to DW_TAG_partial_unit and then again importing those (the spec suggests you need to import DW_TAG_partial_units) would not reflect documented semantics either. While the early CUs represent the original TUs declarations the actual instantiation is split into multiple late CUs. Currently we import the early CUs in each late CU that instantiates at least _one_ of the early CU entities. But as I read the SPEC importing a partial CU means the importing CU will be an instantiation point for _all_ entities in the imported partial CU. So there may not be a good fit for the LTO usage where we have "abstract" units for each TU and "concrete" units for each LTRANS unit picking items to instantiate from various abstract CUs. Splitting the early CUs into multiple DW_TAG_partial_units, one for each object, and selectively only importing the instantiated ones might make it fit better but we then likely have to force the use of type units to carry type DIEs. Note we'd still import the abstract unit for a function when the function is only instantiated inline and elsewhere instantiated concrete. So somehow making the early CUs "abstract" might be a better approach (not sure how gdb would like to have the DWARF represented then).=