From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53577 invoked by alias); 16 Jan 2020 10:20:18 -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 53512 invoked by uid 48); 16 Jan 2020 10:20:13 -0000 From: "vries at gcc dot gnu.org" To: dwz@sourceware.org Subject: [Bug default/25398] New: CU referenced from PU Date: Wed, 01 Jan 2020 00:00:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: dwz X-Bugzilla-Component: default X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: 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: 2020-q1/txt/msg00021.txt https://sourceware.org/bugzilla/show_bug.cgi?id=3D25398 Bug ID: 25398 Summary: CU referenced from PU Product: dwz Version: unspecified Status: NEW Severity: normal Priority: P2 Component: default Assignee: nobody at sourceware dot org Reporter: vries at gcc dot gnu.org CC: dwz at sourceware dot org Target Milestone: --- Consider the benchmark cc1. When compiled like this: ... $ dwz cc1 -o 1 -lnone --no-odr=20 ... we find this duplicate chain: ... duplicate chain: 6a1a881 O 13b1049c f3237179 rounding enumeration_type (type: 6a1a4ec unsig= ned int base_type) 6a25115 O 13b1049c f3237179 rounding enumeration_type (type: 6a24dd3 unsig= ned int base_type) 6a26b99 O 13b1049c f3237179 rounding enumeration_type (type: 6a2685c unsig= ned int base_type) 6a27e84 O 13b1049c f3237179 rounding enumeration_type (type: 6a27b47 unsig= ned int base_type) 6a29495 O 13b1049c f3237179 rounding enumeration_type (type: 6a29158 unsig= ned int base_type) ... which is referencing this (very long, so abbreviated) duplicate chain: ... duplicate chain: 59 O ec21c4f2 ec21c4f2 unsigned int base_type 762fa O ec21c4f2 ec21c4f2 unsigned int base_type 7f7e7 O ec21c4f2 ec21c4f2 unsigned int base_type b4999 O ec21c4f2 ec21c4f2 unsigned int base_type ... 6a19d58 O ec21c4f2 ec21c4f2 unsigned int base_type 6a1a4ec O ec21c4f2 ec21c4f2 unsigned int base_type 6a24dd3 O ec21c4f2 ec21c4f2 unsigned int base_type ... Each of the chains is copied to a partial unit. When we write out the die representing the first duplicate chain, we hit co= de this in write_die: ... if (refdt->die_dup && refdt->die_op_type_referenced) { if (cu =3D=3D die_cu (refdt->die_dup)) refd =3D die_find_dup (refdt, refdt->die_dup, refd); } else if (refdt->die_dup) refd =3D die_find_dup (refdt, refdt->die_dup, refd); ... with refdt->die_dup && refdt->die_op_type_reference true: ... (gdb) p /x *refdt $5 =3D { die_offset =3D 0x6a1a4ec, die_tag =3D 0x24, die_ck_state =3D 0x1, die_op_call2_referenced =3D 0x0,=20 die_op_type_referenced =3D 0x1, <=3D=3D=3D die_named_namespace =3D 0x0, die_ref_hash_computed =3D 0x1,=20 die_toplevel =3D 0x1, die_remove =3D 0x0, die_no_multifile =3D 0x0, die_referenced =3D 0x0,=20 die_intercu_referenced =3D 0x0, die_collapsed_children =3D 0x0, die_collapsed_child =3D 0x0,=20 die_root =3D 0x0, die_odr_state =3D 0x0, die_parent =3D 0x7fffb00a0bf0, die_child =3D 0x0,=20 die_sib =3D 0x7fffb00a0ca0, die_abbrev =3D 0x7fffb009f940, die_size =3D 0x7, die_ref_seen =3D 0x0, u =3D { p1 =3D {die_hash =3D 0xaf5b0d28, die_ref_hash =3D 0x7fff, die_hash2 =3D 0x28, die_enter =3D 0x0, die_exit =3D 0x1}, p2 =3D {die_new_abbrev =3D 0x7fffaf5b0d28, die_new_offset =3D 0x28,=20 die_intracu_udata_size =3D 0x0} }, die_dup =3D 0x7fffb025f5d8, <=3D=3D=3D die_nextdup =3D 0x7fffb00dc5c0 } ... and cu and die_cu (refdt->die_dup) being different partial units: ... (gdb) p *cu $6 =3D { cu_files =3D 0x0, cu_nfiles =3D 0, cu_kind =3D CU_PU, cu_next =3D 0x7fffaeb8bdf0, cu_offset =3D 2099,=20 cu_version =3D 4, cu_comp_dir =3D 0x0, cu_die =3D 0x7fffaeb8a840, cu_abbrev =3D 0x0, cu_new_abbrev =3D 0x0,=20 u1 =3D { cu_new_abbrev_owner =3D 0x7fffb0399ca0, cu_icu =3D 0x7fffb0399ca0 },=20 u2 =3D { cu_new_abbrev_offset =3D 5832, cu_largest_entry =3D 5832 }, cu_new_offset =3D 1244546, cu_chunk =3D 0,=20 cu_intracu_form =3D DW_FORM_ref_udata, initial_intracusize =3D 2, lang =3D 0 } (gdb) p *die_cu (refdt->die_dup) $7 =3D { cu_files =3D 0x0, cu_nfiles =3D 0, cu_kind =3D CU_PU, cu_next =3D 0x7fffb025f630, cu_offset =3D 1,=20 cu_version =3D 4, cu_comp_dir =3D 0x0, cu_die =3D 0x7fffb025f580, cu_abbrev =3D 0x0, cu_new_abbrev =3D 0x0,=20 u1 =3D { cu_new_abbrev_owner =3D 0x7fffb042a200, cu_icu =3D 0x7fffb042a200 }, u2 =3D { cu_new_abbrev_offset =3D 9661, cu_largest_entry =3D 9661 }, cu_new_offset =3D 28, cu_chunk =3D 0,=20 cu_intracu_form =3D DW_FORM_ref_udata, initial_intracusize =3D 1, lang =3D 0 } ... so, the die_find_dup is not applied. This results in this DIE in a PU: ... <0><12fd8d>: Abbrev Number: 11 (DW_TAG_partial_unit) ... <1><12fd9b>: Abbrev Number: 7 (DW_TAG_enumeration_type) <12fd9c> DW_AT_name : rounding <12fda0> DW_AT_encoding : 7 (unsigned) <12fda1> DW_AT_byte_size : 4 <12fda2> DW_AT_type : <0x3a81757> <12fda6> DW_AT_decl_file : 10 <12fda7> DW_AT_decl_line : 69 <12fda8> DW_AT_decl_column : 8 <12fda9> DW_AT_sibling : <0x12fde1> ... referring to this DIE in a CU: ... <0><3a8173a>: Abbrev Number: 41 (DW_TAG_compile_unit) <3a81740> DW_AT_name : ../../libdecnumber/decNumber.c ... <1><3a81757>: Abbrev Number: 27 (DW_TAG_base_type) <3a81758> DW_AT_byte_size : 4 <3a81759> DW_AT_encoding : 7 (unsigned) <3a8175a> DW_AT_name : unsigned int ... --=20 You are receiving this mail because: You are on the CC list for the bug.