Bug 78871 - Anonymous namespace and -flto -gsplit-dwarf: ICE in lhd_decl_printable_name, at langhooks.c:215
Summary: Anonymous namespace and -flto -gsplit-dwarf: ICE in lhd_decl_printable_name, ...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 7.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: ice-on-valid-code
Depends on:
Reported: 2016-12-20 16:10 UTC by Markus Trippelsdorf
Modified: 2019-06-18 10:50 UTC (History)
0 users

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2016-12-20 00:00:00


Note You need to log in before you can comment on or make changes to this bug.
Description Markus Trippelsdorf 2016-12-20 16:10:49 UTC
All supported gcc versions are affected:

markus@x4 ~ % cat Util.ii
namespace {
void foo() {}

markus@x4 ~ % g++ -flto -gsplit-dwarf Util.ii
Util.ii: In function ‘foo’:
Util.ii:2:13: internal compiler error: in lhd_decl_printable_name, at langhooks.c:215
 void foo() {}
0x8eec74 lhd_decl_printable_name(tree_node*, int)
0x6ffa74 gen_namespace_die
0x6ffa74 gen_decl_die
0x70078e dwarf2out_decl
0x706c2f force_decl_die
0x706de5 declare_in_namespace
0x700127 declare_in_namespace
0x700127 gen_decl_die
0x70078e dwarf2out_decl
0x700cde dwarf2out_function_decl
0x7762ef rest_of_handle_final
0x7762ef execute
Please submit a full bug report,
Comment 1 Martin Liška 2016-12-20 16:46:02 UTC
Comment 2 Christian Gagneraud 2019-06-18 10:49:26 UTC
Confimed, that's exactly what i was trying to achieve: -flto and -gsplit-dwarf at the same time.

gcc 7.4.0-1ubuntu1~18.04.1
Comment 3 Christian Gagneraud 2019-06-18 10:50:44 UTC
And if I switch to gcc-8, I get: 
cc1plus: note: ‘-gsplit-dwarf’ is not supported with LTO, disabling