From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 596E939450F3; Fri, 27 Mar 2020 08:37:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 596E939450F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1585298236; bh=LWFQQw1FsAss41CGTZ0mZHzQJXegsc8TUM89UMd8AyE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pTrJhAVdzxBFRa/d4ZIlNHxH6LOjKiNcCqONlbtO4dVMnh3AVxSQKXDWy4S05mjxc qMihg7T4H5ILQccGWy8Snx06h2CL8YE0evR9TEL2iJiC001hfGwft4dlbzbc8lcii9 1kORWLm+2W4gcd4V8ETrvtY6SLsnQJIe/8MWWU18= From: "rguenth at gcc dot gnu.org" 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: Fri, 27 Mar 2020 08:37:15 +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: rguenth at gcc dot gnu.org 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: Fri, 27 Mar 2020 08:37:16 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94273 --- Comment #9 from Richard Biener --- OK, so during early creation of the DIE for the type we end up in static void gen_struct_or_union_type_die (tree type, dw_die_ref context_die, enum debug_info_usage usage) { ... int complete =3D (TYPE_SIZE (type) && (! TYPE_STUB_DECL (type) || ! TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type))= )); where complete is false because of TYPE_DECL_SUPPRESS_DEBUG. When record the type to be re-processed later and between now and then the C++ FE does note_debug_info_needed via maybe_emit_vtables and clears TYPE_DECL_SUPPRESS_DEBUG, causing the type to be completed during=20 retry_incomplete_types processing. I think PR93951 may be related in the end because the conditions on when exactly we emit what parts of debug info is quite intricate in dwarf2out. Now, for this bug I guess we should choose to piggy-back on that, making should_emit_struct_debug return false for DINFO_LEVEL_TERSE or initializing debug_struct_{generic,ordinary} accordingly. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b1fa6f5ff7c..378a27394e8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -399,6 +399,9 @@ get_full_len (const wide_int &op) static bool should_emit_struct_debug (tree type, enum debug_info_usage usage) { + if (debug_info_level <=3D DINFO_LEVEL_TERSE) + return false; + enum debug_struct_file criterion; tree type_decl; bool generic =3D lang_hooks.types.generic_p (type); thoughts? The DWARF we generate for the testcase at -g1 is then <0>: Abbrev Number: 1 (DW_TAG_compile_unit) DW_AT_producer : (indirect string, offset: 0x0): GNU C++14 10.= 0.1 2 0200325 (experimental) -mtune=3Dgeneric -march=3Dx86-64 -g1 <10> DW_AT_language : 4 (C++) <11> DW_AT_name : (indirect string, offset: 0x4a): t.ii <15> DW_AT_comp_dir : (indirect string, offset: 0x4f): /home/rguenther/ obj/gcc <19> DW_AT_ranges : 0x0 <1d> DW_AT_low_pc : 0x0 <25> DW_AT_stmt_list : 0x0 <1><29>: Abbrev Number: 2 (DW_TAG_variable) <2a> DW_AT_name : b <2c> DW_AT_decl_file : 1 <2d> DW_AT_decl_line : 3 <2e> DW_AT_decl_column : 12 <2f> DW_AT_external : 1 <2f> DW_AT_declaration : 1 <1><2f>: Abbrev Number: 3 (DW_TAG_variable) <30> DW_AT_specification: <0x29> <34> DW_AT_decl_line : 4 <35> DW_AT_decl_column : 5 <36> DW_AT_location : 9 byte block: 3 0 0 0 0 0 0 0 0 (DW_OP_addr= : 0) <1><40>: Abbrev Number: 4 (DW_TAG_subprogram) <41> DW_AT_external : 1 <41> DW_AT_name : c <43> DW_AT_decl_file : 1 <44> DW_AT_decl_line : 2 <45> DW_AT_decl_column : 16 <46> DW_AT_linkage_name: (indirect string, offset: 0x67): _ZN1a1cEv <4a> DW_AT_virtuality : 1 (virtual) <4b> DW_AT_vtable_elem_location: 2 byte block: 10 0 (DW_OP_cons= tu: 0) <4e> DW_AT_accessibility: 3 (private) <4f> DW_AT_low_pc : 0x0 <57> DW_AT_high_pc : 0xb <5f> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_c= fa) <61> DW_AT_GNU_all_call_sites: 1 <1><61>: Abbrev Number: 0=