public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/94469] lto abstract variable emitted as concrete decl (ada test-case)
Date: Mon, 06 Apr 2020 11:27:40 +0000	[thread overview]
Message-ID: <bug-94469-4-oC2Uf5j5PF@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94469-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #7)
> (In reply to Richard Biener from comment #6)
> > Btw, I still wonder how it works with abstract functions, inline and
> > concrete instances.  Works in gdb, that is - will dig into it a bit after
> > lunch.
> 
> So here I see us (without LTO) putting DW_AT_location attributes on the
> abstract instance copy.  That kind-of makes it not abstract anymore, no?
> But that way we avoid emitting multiple DIEs for local statics.  With
> -flto the same problem appears there because we cannot annotate the
> early CUs DIE with a location so the concrete instance copy
> gets [generated and] the location.
> 
> So while I intended to have the early CUs behave like fully abstract
> the actual DWARF is different.  I understand that if I emit the early CU as
> partial unit it becomes abstract?

Well, that's my theory.

I've created a minimal dwarf assembler variant corresponding to the C test-case
(with only var aaa), and I could reproduce the problem, however after changing
the tag to DW_TAG_partial_unit still a symbol table for that partial unit was
created. It seems that the inter-cu ref handling code is responsible for that.
I'll try to fix this.

>  Note we do emit DW_AT_const_value
> to early optimized out decls - would those still be found when the early CU
> is partial [and not imported anywhere]?

I think so, but I could check with the dwarf assembler test-case.

  parent reply	other threads:[~2020-04-06 11:27 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 13:22 [Bug debug/94469] New: " vries at gcc dot gnu.org
2020-04-06  6:08 ` [Bug debug/94469] " rguenth at gcc dot gnu.org
2020-04-06  9:32 ` vries at gcc dot gnu.org
2020-04-06  9:35 ` rguenth at gcc dot gnu.org
2020-04-06  9:49 ` vries at gcc dot gnu.org
2020-04-06  9:54 ` vries at gcc dot gnu.org
2020-04-06  9:56 ` rguenth at gcc dot gnu.org
2020-04-06 10:44 ` rguenth at gcc dot gnu.org
2020-04-06 11:27 ` vries at gcc dot gnu.org [this message]
2020-04-06 11:38 ` rguenth at gcc dot gnu.org
2020-04-06 11:50 ` rguenth at gcc dot gnu.org
2020-04-07 12:09 ` vries at gcc dot gnu.org
2020-04-07 12:22 ` rguenther at suse dot de
2020-04-07 13:53 ` vries at gcc dot gnu.org
2020-04-07 14:09 ` rguenth at gcc dot gnu.org
2020-04-07 15:18 ` vries at gcc dot gnu.org
2020-04-07 15:27 ` vries at gcc dot gnu.org
2020-04-08 10:47 ` rguenth 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-94469-4-oC2Uf5j5PF@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).