From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0B7B23938C2A; Fri, 19 Feb 2021 08:45:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B7B23938C2A From: "vries at gcc dot gnu.org" To: dwz@sourceware.org Subject: [Bug default/27438] New: [dwz, odr, multifile] Multifile after odr not optimal Date: Fri, 19 Feb 2021 08:45:13 +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-BeenThere: dwz@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Dwz mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2021 08:45:14 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27438 Bug ID: 27438 Summary: [dwz, odr, multifile] Multifile after odr not optimal 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 odr-struct: ... $ make odr-struct ... It has two structs aaa (from different CUs), each with member of type bbb a= nd ccc, but in one case bbb is a decl, in the other case ccc is a decl: ... $ readelf -wi odr-struct | egrep -A2 "DW_TAG_structure" | egrep "DW_TAG|DW_AT_name|DW_AT_decl" <1>: Abbrev Number: 2 (DW_TAG_structure_type) DW_AT_name : ccc <1><114>: Abbrev Number: 2 (DW_TAG_structure_type) <115> DW_AT_name : aaa <1><139>: Abbrev Number: 5 (DW_TAG_structure_type) <13a> DW_AT_name : bbb <13e> DW_AT_declaration : 1 <1><1af>: Abbrev Number: 2 (DW_TAG_structure_type) <1b0> DW_AT_name : bbb <1><1cf>: Abbrev Number: 2 (DW_TAG_structure_type) <1d0> DW_AT_name : aaa <1><1fa>: Abbrev Number: 6 (DW_TAG_structure_type) <1fb> DW_AT_name : ccc <1ff> DW_AT_declaration : 1 ... And we keep the same when doing dwz: ... $ cp odr-struct 1; ./dwz 1 $ readelf -wi 1 | egrep -A2 "DW_TAG_structure" | egrep "DW_TAG|DW_AT_name|DW_AT_decl" <1>: Abbrev Number: 23 (DW_TAG_structure_type) DW_AT_name : ccc <1><101>: Abbrev Number: 23 (DW_TAG_structure_type) <102> DW_AT_name : aaa <1><11d>: Abbrev Number: 27 (DW_TAG_structure_type) <11e> DW_AT_name : bbb <122> DW_AT_declaration : 1 <1><17d>: Abbrev Number: 23 (DW_TAG_structure_type) <17e> DW_AT_name : bbb <1><197>: Abbrev Number: 23 (DW_TAG_structure_type) <198> DW_AT_name : aaa <1><1b6>: Abbrev Number: 27 (DW_TAG_structure_type) <1b7> DW_AT_name : ccc <1bb> DW_AT_declaration : 1 ... When doing odr, we end up with one struct aaa, and no decls: ... $ cp odr-struct 1; ./dwz 1 --odr $ readelf -wi 1 | egrep -A2 "DW_TAG_structure" | egrep "DW_TAG|DW_AT_name|DW_AT_decl" <1><19>: Abbrev Number: 25 (DW_TAG_structure_type) <1a> DW_AT_name : ccc <1><2f>: Abbrev Number: 25 (DW_TAG_structure_type) <30> DW_AT_name : aaa <1><4b>: Abbrev Number: 25 (DW_TAG_structure_type) <4c> DW_AT_name : bbb ... Now consider: ... $ cp odr-struct 1; cp 1 2; ./dwz -m 3 1 2 --odr=20 ... The desired outcome is that the structs aaa are unified in both 1 and 2, and then moved to multifile 3. Sofar, so good: ... $ readelf -wi 3 | egrep -A2 "DW_TAG_structure" | egrep "DW_TAG|DW_AT_name|DW_AT_decl" <1><14>: Abbrev Number: 15 (DW_TAG_structure_type) <15> DW_AT_name : ccc <1><2a>: Abbrev Number: 15 (DW_TAG_structure_type) <2b> DW_AT_name : aaa <1><46>: Abbrev Number: 15 (DW_TAG_structure_type) <47> DW_AT_name : bbb ... But: ... $ readelf -wi 1 | egrep -A2 "DW_TAG_structure" | egrep "DW_TAG|DW_AT_name|DW_AT_decl" <1><1e>: Abbrev Number: 12 (DW_TAG_structure_type) <1f> DW_AT_name : aaa <1><3d>: Abbrev Number: 12 (DW_TAG_structure_type) <3e> DW_AT_name : bbb ... And it's not just that these are dead dies left behind. The 0x1e DIE is us= ed here: ... <1><114>: Abbrev Number: 20 (DW_TAG_variable) <115> DW_AT_name : (alt indirect string, offset: 0xe) <11b> DW_AT_type : <0x1e> ... --=20 You are receiving this mail because: You are on the CC list for the bug.=