From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.org>
To: dwz@sourceware.org
Subject: [Bug default/25450] New: Compress member function template DIEs
Date: Wed, 01 Jan 2020 00:00:00 -0000 [thread overview]
Message-ID: <bug-25450-11298@http.sourceware.org/bugzilla/> (raw)
https://sourceware.org/bugzilla/show_bug.cgi?id=25450
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<typename T> 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><f0>: Abbrev Number: 2 (DW_TAG_structure_type)
<f1> DW_AT_name : aaa
<f5> DW_AT_byte_size : 1
<f6> DW_AT_decl_file : 2
<f7> DW_AT_decl_line : 1
<f8> DW_AT_sibling : <0x143>
<2><fc>: Abbrev Number: 3 (DW_TAG_subprogram)
<fd> DW_AT_external : 1
<fd> DW_AT_name : (indirect string, offset: 0x1d0): foo<float>
<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<int>
<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<double>
<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.
--
You are receiving this mail because:
You are on the CC list for the bug.
next reply other threads:[~2020-01-23 17:10 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-01 0:00 vries at gcc dot gnu.org [this message]
2020-01-01 0:00 ` [Bug default/25450] " vries at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-25450-11298@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=dwz@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).