From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1EA013858408; Mon, 13 Feb 2023 15:14:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EA013858408 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676301264; bh=uysFmrXfz+6TWQge+nz4hQkUWPdsZgEE2GnMgtNMN/s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mfX2x0HpmPuJDFrkKO4A/7AEuW7R9uAV4Daf3hhBjFFnWjN7Ad6tCytTd4rue5XGC 7cezi5nH+zJY7DHn7gfjQ/9fezDlG9n4N5KWmLG+xkHrDSiseqJozupcsqqRThRrwF G0br7daozZqulAlnNLMiyLDk1c1HBbJlUxoH+C1k= From: "rguenth at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org 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: 13.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108772 --- Comment #3 from Richard Biener --- (In reply to Martin Li=C5=A1ka from comment #2) > (In reply to Jakub Jelinek from comment #1) > > Does firefox really use -fimplicit-constexpr and -g1? >=20 > Yes. Note the former option is used since gcc12: > https://bugzilla.mozilla.org/show_bug.cgi?id=3D1754752 Note 'decl' is 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 <=3D 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 >=3D 3 || !dwarf_strict) + if (debug_info_level > DINFO_LEVEL_TERSE + && (dwarf_version >=3D 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?=