public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/108772] [13 Regression] ICE in force_decl_die, at dwarf2out.cc:26751 since r13-4161-g32d16fe9d7e347bc
Date: Mon, 13 Feb 2023 15:14:23 +0000	[thread overview]
Message-ID: <bug-108772-4-4qMv7SrQBv@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108772-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #2)
> (In reply to Jakub Jelinek from comment #1)
> > Does firefox really use -fimplicit-constexpr and -g1?
> 
> Yes. Note the former option is used since gcc12:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1754752

Note 'decl' is <namespace_decl 0x7ffff60d1260 std> for me.  For dwarf2
we return comp_unit_die () for this, but for -g1 we run into

    case NAMESPACE_DECL:
    case IMPORTED_DECL:
      if (debug_info_level <= DINFO_LEVEL_TERSE)
        return;

so maybe for force_decl_die we want to do the same or alternatively
for get_context_die () allow force_decl_die to "fail" and force one
for the next up context up to comp_unit_die ()?

OTOH, we run into this for a limbo entry that in the end likely will
not get any DIE at -g1 anyway, so "forcing" a context via get_context_die
is possibly excessive as well.

So I think the actual bug is that we created a DIE for __tag when -g1
doesn't want a DIE for its ultimate context.

Alternative make force_decl_die honor the dwarf2out_decl reality like
with

diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc
index 1f39df3b1e2..bd2c9444ff3 100644
--- a/gcc/dwarf2out.cc
+++ b/gcc/dwarf2out.cc
@@ -26742,7 +26742,8 @@ force_decl_die (tree decl)
          break;

        case NAMESPACE_DECL:
-         if (dwarf_version >= 3 || !dwarf_strict)
+         if (debug_info_level > DINFO_LEVEL_TERSE
+             && (dwarf_version >= 3 || !dwarf_strict))
            dwarf2out_decl (decl);
          else
            /* DWARF2 has neither DW_TAG_module, nor DW_TAG_namespace.  */

in which case we'll put the function decl context in the CU DIE rather
than in a namespace DIE?

  parent reply	other threads:[~2023-02-13 15:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 12:06 [Bug c++/108772] New: " marxin at gcc dot gnu.org
2023-02-13 12:06 ` [Bug debug/108772] " marxin at gcc dot gnu.org
2023-02-13 12:35 ` jakub at gcc dot gnu.org
2023-02-13 14:00 ` marxin at gcc dot gnu.org
2023-02-13 15:14 ` rguenth at gcc dot gnu.org [this message]
2023-02-14 11:50 ` rguenth at gcc dot gnu.org
2023-02-14 12:22 ` rguenth at gcc dot gnu.org
2023-02-20 13:37 ` rguenth at gcc dot gnu.org
2023-02-21 12:26 ` rguenth at gcc dot gnu.org
2023-02-21 12:48 ` rguenth at gcc dot gnu.org
2023-02-21 13:32 ` rguenth at gcc dot gnu.org
2023-03-03  7:27 ` cvs-commit at gcc dot gnu.org
2023-03-03  7:34 ` 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-108772-4-4qMv7SrQBv@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).