From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6AD98385E009; Thu, 26 Mar 2020 19:01:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6AD98385E009 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585249268; bh=833hMbB/U8/vP4eQrusbysUWb8Dk1nGEe0PwopHdlRo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=coHe9d8fHXj5/aiBvLmTgpV8Oqrj8tTg9kY8VidRQi3vrBj9FkBxBWL31M2dX0i42 Yr6TT5Rix3QqxMpn+Q5GIXnw7dEFu6qBwihgynKoKGmeJlpOT4LIEPCafFwzNs3slS MW5mZHjcinS/MtmSWBWIaiXcoIzGU9tmQ6JjUtto= From: "stilor at att dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/94273] [10 Regression] ICE in splice_child_die, at dwarf2out.c:5657 since r10-7235-g52b3aa8be1893848 Date: Thu, 26 Mar 2020 19:01:08 +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: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: stilor at att dot net X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.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 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: Thu, 26 Mar 2020 19:01:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94273 --- Comment #7 from Alexey Neyman --- (In reply to Richard Biener from comment #6) > (In reply to Alexey Neyman from comment #4) > > Or add a similar "return if debug level is terse" at the beginning of > > `gen_type_die` - I didn't notice that in C++ it could also get called n= ot > > through the `add_type_attribute`: > >=20 > > ``` > > diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c > > index 89e52a41508..b0f6680bd61 100644 > > --- a/gcc/dwarf2out.c > > +++ b/gcc/dwarf2out.c > > @@ -25709,6 +25709,9 @@ gen_type_die_with_usage (tree type, dw_die_ref > > context_die, > > static void > > gen_type_die (tree type, dw_die_ref context_die) > > { > > + if (debug_info_level <=3D DINFO_LEVEL_TERSE) > > + return; > > + > > if (type !=3D error_mark_node) > > { > > gen_type_die_with_usage (type, context_die, DINFO_USAGE_DIR_USE); > > ``` > >=20 > > I verified that it makes the attached test case compile successfully. >=20 > But then the static var is improperly scoped in the debug info? IMHO > it's better left out. First, which static variable? The test case for this PR does not have any static vars: ``` class a { virtual void c() {} } extern b; a b; ``` As to DECL_FILE_SCOPE_P check, do you mean something like this? ``` @@ -26360,7 +26365,8 @@ gen_decl_die (tree decl, tree origin, struct vlr_context *ctx, variable declarations or definitions unless it is external. */ if (debug_info_level < DINFO_LEVEL_TERSE || (debug_info_level =3D=3D DINFO_LEVEL_TERSE - && !TREE_PUBLIC (decl_or_origin))) + && (!TREE_PUBLIC (decl_or_origin) + || !DECL_FILE_SCOPE_P(decl_or_origin)))) break; if (debug_info_level > DINFO_LEVEL_TERSE) { @@ -26841,7 +26847,8 @@ dwarf2out_decl (tree decl) variable declarations or definitions unless it is external. */ if (debug_info_level < DINFO_LEVEL_TERSE || (debug_info_level =3D=3D DINFO_LEVEL_TERSE - && !TREE_PUBLIC (decl))) + && (!TREE_PUBLIC (decl) + || !DECL_FILE_SCOPE_P(decl)))) return; break; ``` This change doesn't resolve the ICE with that test. I am going to attach a patch with what I suggested. Whether it is accepted,= or something different needs to be done - I don't have commit access, so someb= ody else will have to commit it.=