From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95614 invoked by alias); 23 Jan 2020 17:10:54 -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 95538 invoked by uid 48); 23 Jan 2020 17:10:49 -0000 From: "vries at gcc dot gnu.org" To: dwz@sourceware.org Subject: [Bug default/25450] New: Compress member function template DIEs 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: 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: 2020-q1/txt/msg00042.txt https://sourceware.org/bugzilla/show_bug.cgi?id=3D25450 Bug ID: 25450 Summary: Compress member function template DIEs 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 the following test-case. test.h: ... struct aaa { template void foo(T obj) {} }; ... test.cc: ... extern void other_unit (void); #include "test.h" struct aaa var; int main (void) { int a; float f; var.foo (a); var.foo (f); other_unit (); return 0; } ... test2.cc: ... #include "test.h" struct aaa var2; void other_unit (void) { double d; var2.foo (d); } ... Compiled like this: ... $ g++ test.cc test2.cc -g ... In the test.cc compilation unit, we have: ... <1>: Abbrev Number: 2 (DW_TAG_structure_type) DW_AT_name : aaa DW_AT_byte_size : 1 DW_AT_decl_file : 2 DW_AT_decl_line : 1 DW_AT_sibling : <0x143> <2>: Abbrev Number: 3 (DW_TAG_subprogram) DW_AT_external : 1 DW_AT_name : (indirect string, offset: 0x1d0): foo <101> DW_AT_decl_file : 2 <102> DW_AT_decl_line : 3 <103> DW_AT_linkage_name: (indirect string, offset: 0x262): _ZN3aaa3fooIfEEvT_ <107> DW_AT_declaration : 1 <107> DW_AT_object_pointer: <0x116> <10b> DW_AT_sibling : <0x121> <3><10f>: Abbrev Number: 4 (DW_TAG_template_type_param) <110> DW_AT_name : T <112> DW_AT_type : <0x158> <3><116>: Abbrev Number: 5 (DW_TAG_formal_parameter) <117> DW_AT_type : <0x15f> <11b> DW_AT_artificial : 1 <3><11b>: Abbrev Number: 6 (DW_TAG_formal_parameter) <11c> DW_AT_type : <0x158> <3><120>: Abbrev Number: 0 <2><121>: Abbrev Number: 7 (DW_TAG_subprogram) <122> DW_AT_external : 1 <122> DW_AT_name : (indirect string, offset: 0x254): foo <126> DW_AT_decl_file : 2 <127> DW_AT_decl_line : 3 <128> DW_AT_linkage_name: (indirect string, offset: 0x1db): _ZN3aaa3fooIiEEvT_ <12c> DW_AT_declaration : 1 <12c> DW_AT_object_pointer: <0x137> <3><130>: Abbrev Number: 4 (DW_TAG_template_type_param) <131> DW_AT_name : T <133> DW_AT_type : <0x1af> <3><137>: Abbrev Number: 5 (DW_TAG_formal_parameter) <138> DW_AT_type : <0x15f> <13c> DW_AT_artificial : 1 <3><13c>: Abbrev Number: 6 (DW_TAG_formal_parameter) <13d> DW_AT_type : <0x1af> ... And in the test2.cc compilation unit, we have: ... <1><25b>: Abbrev Number: 2 (DW_TAG_structure_type) <25c> DW_AT_name : aaa <260> DW_AT_byte_size : 1 <261> DW_AT_decl_file : 2 <262> DW_AT_decl_line : 1 <263> DW_AT_sibling : <0x289> <2><267>: Abbrev Number: 3 (DW_TAG_subprogram) <268> DW_AT_external : 1 <268> DW_AT_name : (indirect string, offset: 0x2b7): foo <26c> DW_AT_decl_file : 2 <26d> DW_AT_decl_line : 3 <26e> DW_AT_linkage_name: (indirect string, offset: 0x27b): _ZN3aaa3fooIdEEvT_ <272> DW_AT_declaration : 1 <272> DW_AT_object_pointer: <0x27d> <3><276>: Abbrev Number: 4 (DW_TAG_template_type_param) <277> DW_AT_name : T <279> DW_AT_type : <0x29e> <3><27d>: Abbrev Number: 5 (DW_TAG_formal_parameter) <27e> DW_AT_type : <0x2a5> <282> DW_AT_artificial : 1 <3><282>: Abbrev Number: 6 (DW_TAG_formal_parameter) <283> DW_AT_type : <0x29e> ... Despite the fact that the two DIEs are generated from the same header file, they are structurally different, due to the different instantiations of the member function template. Consequently, dwz does not factor out the DIEs. --=20 You are receiving this mail because: You are on the CC list for the bug.