From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80664 invoked by alias); 28 Oct 2019 09:03:33 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 80613 invoked by uid 48); 28 Oct 2019 09:03:28 -0000 From: "vries at gcc dot gnu.org" To: dwz@sourceware.org Subject: [Bug default/25137] import dwarf assembler from gdb testsuite Date: Tue, 01 Jan 2019 00:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: dwz X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: nobody at sourceware dot org X-Bugzilla-Target-Milestone: --- 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2019-q4/txt/msg00024.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25137 --- Comment #1 from Tom de Vries --- (In reply to Tom de Vries from comment #0) > The dwz code handles certain cases that may not be triggered with current > toolchains. >=20 > F.i. we have in partition_dups_1: > ... > /* If there are dups within a single CU=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20 >=20 > (arguably a bug in the DWARF producer),=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 >=20 > keep them linked together, but don't link=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 >=20 > DIEs across different CUs. */ > ... >=20 I added an assert to detect this situation, and it didn't trigger in the regular test suite, but it did in the external testsuite. I've minimized this to: ... struct a { int b; }; void foo1 (int x) { struct a var[x]; } void foo2 (int y) { struct a var[y]; } int main () { foo1 (5); foo2 (6); return 0; } ... And compiled as: ... $ gcc-9 test.c -g ... The duplicate is on the basis that the array types 0x16c and 0x1c2 have a subrange with identical exprloc as DW_AT_upper_bound: ... <1>: Abbrev Number: 2 (DW_TAG_structure_type) DW_AT_name : a DW_AT_byte_size : 4 DW_AT_decl_file : 1 DW_AT_decl_line : 1 DW_AT_decl_column : 8 DW_AT_sibling : <0x10b> <2>: Abbrev Number: 3 (DW_TAG_member) <100> DW_AT_name : b <102> DW_AT_decl_file : 1 <103> DW_AT_decl_line : 2 <104> DW_AT_decl_column : 7 <105> DW_AT_type : <0x10b> <109> DW_AT_data_member_location: 0 <2><10a>: Abbrev Number: 0 <1><10b>: Abbrev Number: 4 (DW_TAG_base_type) <10c> DW_AT_byte_size : 4 <10d> DW_AT_encoding : 5 (signed) <10e> DW_AT_name : int <1><130>: Abbrev Number: 6 (DW_TAG_subprogram) <131> DW_AT_name : (indirect string, offset: 0x237): foo2 <1><16c>: Abbrev Number: 9 (DW_TAG_array_type) <16d> DW_AT_type : <0xf4> <171> DW_AT_sibling : <0x17f> <2><175>: Abbrev Number: 10 (DW_TAG_subrange_type) <176> DW_AT_type : <0x17f> <17a> DW_AT_upper_bound : 3 byte block: 91 68 6 (DW_OP_fbreg: -24; DW_OP_deref) <1><17f>: Abbrev Number: 11 (DW_TAG_base_type) <180> DW_AT_byte_size : 8 <181> DW_AT_encoding : 7 (unsigned) <182> DW_AT_name : (indirect string, offset: 0x53): long unsig= ned int <1><186>: Abbrev Number: 6 (DW_TAG_subprogram) <187> DW_AT_external : 1 <187> DW_AT_name : (indirect string, offset: 0x232): foo1 <1><1c2>: Abbrev Number: 12 (DW_TAG_array_type) <1c3> DW_AT_type : <0xf4> <2><1c7>: Abbrev Number: 10 (DW_TAG_subrange_type) <1c8> DW_AT_type : <0x17f> <1cc> DW_AT_upper_bound : 3 byte block: 91 68 6 (DW_OP_fbreg: -24; DW_OP_deref) ... I'm not sure that this qualifies as bug in DWARF producer. --=20 You are receiving this mail because: You are on the CC list for the bug.