https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82273
Bug ID: 82273 Summary: unnecessary dwarf info Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug Assignee: unassigned at gcc dot gnu.org Reporter: nathan at gcc dot gnu.org Target Milestone: --- Created attachment 42213 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42213&action=edit example frob(int) is inlined into caller. the dwarf info for an inlinable function's abstract decl contains an linkage_name field, even when there is no non-inlined body emitted. This seems wasteful (and is leading to user confusion). For example the attached program compiled with -g -O2 has the following snipped of dwarf: <2><5d>: Abbrev Number: 4 (DW_TAG_inlined_subroutine) <5e> DW_AT_abstract_origin: <0x82> <62> DW_AT_low_pc : 0x3 <6a> DW_AT_high_pc : 0x3 <72> DW_AT_call_file : 1 <73> DW_AT_call_line : 9 ... <1><82>: Abbrev Number: 7 (DW_TAG_subprogram) <83> DW_AT_external : 1 <83> DW_AT_name : (indirect string, offset: 0x90): frob <87> DW_AT_decl_file : 1 <88> DW_AT_decl_line : 1 <89> DW_AT_linkage_name: (indirect string, offset: 0x87): _Z4frobi <8d> DW_AT_type : <0x7b> <91> DW_AT_inline : 3 (declared as inline and inlined) The external marker is also a little confusing