https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90981
--- Comment #6 from Mark Wielaard <mark at gcc dot gnu.org> --- Author: mark Date: Wed Jul 3 13:08:01 2019 New Revision: 273008 URL: https://gcc.gnu.org/viewcvs?rev=273008&root=gcc&view=rev Log: PR debug/90981 Empty .debug_addr crashes -gdwarf-5 -gsplit-dwarf Even if there was no, or an empty address list we would try to generate a header for the .debug_addr section with -gdwarf-5 and -gsplit-dwarf. The skeleton DIE would also get a (dangling) DW_AT_addr_base in that case. PR debug/90981 * dwarf2out.c (add_top_level_skeleton_die_attrs): Only add DW_AT_addr_base if there is actually a .debug_addr section with addresses. (output_addr_table): Add DWARF5 table header generation here after checking there are actually any addresses from... (dwarf2out_finish): ...here. * testsuite/g++.dg/pr90981.C: New test. Added: trunk/gcc/testsuite/g++.dg/pr90981.C Modified: trunk/gcc/ChangeLog trunk/gcc/dwarf2out.c