From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7611 invoked by alias); 9 Feb 2019 15:27:47 -0000 Mailing-List: contact dwz-help@sourceware.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Subscribe: Sender: dwz-owner@sourceware.org Received: (qmail 7593 invoked by uid 48); 9 Feb 2019 15:27:43 -0000 From: "vries at gcc dot gnu.org" To: dwz@sourceware.org Subject: [Bug default/24198] New: [dwz, c++] Merge odr type definitions Date: Tue, 01 Jan 2019 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: 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: 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: 2019-q1/txt/msg00015.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=3D24198 Bug ID: 24198 Summary: [dwz, c++] Merge odr type definitions Product: dwz Version: unspecified Status: NEW Severity: enhancement 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 this test-case with this: ... $ cat test.c struct bbb; struct ccc { int c; }; #include "aaa.h" extern void foo (struct aaa *); int main (void) { struct aaa *p =3D (struct aaa *)0; foo (p); return 0; } ... and this file: ... $ cat test2.c struct bbb { int b; }; struct ccc; #include "aaa.h" void foo (struct aaa *p) { } ... and this header file: ... $ cat aaa.h struct aaa { struct bbb *b; struct ccc *c; }; ... Compiled for c++: ... $ g++ test.c test2.c -g -c $ g++ test.o test2.o -g ... This results in two DWARF definitions of aaa. This one, with ccc a complete type and bbb an incomplete one: ... <1>: Abbrev Number: 2 (DW_TAG_structure_type) DW_AT_name : ccc DW_AT_byte_size : 4 DW_AT_decl_file : 1 DW_AT_decl_line : 2 DW_AT_decl_column : 8 DW_AT_sibling : <0x10d> <1><114>: Abbrev Number: 2 (DW_TAG_structure_type) <115> DW_AT_name : aaa <119> DW_AT_byte_size : 16 <11a> DW_AT_decl_file : 2 <11b> DW_AT_decl_line : 1 <11c> DW_AT_decl_column : 8 <11d> DW_AT_sibling : <0x138> <2><121>: Abbrev Number: 3 (DW_TAG_member) <122> DW_AT_name : b <124> DW_AT_decl_file : 2 <125> DW_AT_decl_line : 3 <126> DW_AT_decl_column : 15 <127> DW_AT_type : <0x13d> <12b> DW_AT_data_member_location: 0 <2><12c>: Abbrev Number: 3 (DW_TAG_member) <12d> DW_AT_name : c <12f> DW_AT_decl_file : 2 <130> DW_AT_decl_line : 4 <131> DW_AT_decl_column : 15 <132> DW_AT_type : <0x143> <136> DW_AT_data_member_location: 8 <1><138>: Abbrev Number: 5 (DW_TAG_structure_type) <139> DW_AT_name : bbb <13d> DW_AT_declaration : 1 <1><13d>: Abbrev Number: 6 (DW_TAG_pointer_type) <13e> DW_AT_byte_size : 8 <13f> DW_AT_type : <0x138> <1><143>: Abbrev Number: 6 (DW_TAG_pointer_type) <144> DW_AT_byte_size : 8 <145> DW_AT_type : <0xf4> ... And this one, with bbb a complete type and ccc an incomplete one: ... <1><1ad>: Abbrev Number: 2 (DW_TAG_structure_type) <1ae> DW_AT_name : bbb <1b2> DW_AT_byte_size : 4 <1b3> DW_AT_decl_file : 1 <1b4> DW_AT_decl_line : 1 <1b5> DW_AT_decl_column : 8 <1b6> DW_AT_sibling : <0x1c6> <1><1cd>: Abbrev Number: 2 (DW_TAG_structure_type) <1ce> DW_AT_name : aaa <1d2> DW_AT_byte_size : 16 <1d3> DW_AT_decl_file : 2 <1d4> DW_AT_decl_line : 1 <1d5> DW_AT_decl_column : 8 <1d6> DW_AT_sibling : <0x1f1> <2><1da>: Abbrev Number: 3 (DW_TAG_member) <1db> DW_AT_name : b <1dd> DW_AT_decl_file : 2 <1de> DW_AT_decl_line : 3 <1df> DW_AT_decl_column : 15 <1e0> DW_AT_type : <0x1f1> <1e4> DW_AT_data_member_location: 0 <2><1e5>: Abbrev Number: 3 (DW_TAG_member) <1e6> DW_AT_name : c <1e8> DW_AT_decl_file : 2 <1e9> DW_AT_decl_line : 4 <1ea> DW_AT_decl_column : 15 <1eb> DW_AT_type : <0x1fc> <1ef> DW_AT_data_member_location: 8 <1><1f1>: Abbrev Number: 5 (DW_TAG_pointer_type) <1f2> DW_AT_byte_size : 8 <1f3> DW_AT_type : <0x1ad> <1><1f7>: Abbrev Number: 6 (DW_TAG_structure_type) <1f8> DW_AT_name : ccc <1fc> DW_AT_declaration : 1 <1><1fc>: Abbrev Number: 5 (DW_TAG_pointer_type) <1fd> DW_AT_byte_size : 8 <1fe> DW_AT_type : <0x1f7> ... Using the C++ one-definition-rule, we can merge the two definitions. --=20 You are receiving this mail because: You are on the CC list for the bug.