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
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2016-12-20 16:10 UTC by Markus Trippelsdorf
Modified: 2019-06-18 10:50 UTC (History)
3 users (show)

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


Attachments

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)
        /home/markus/gcc/gcc/langhooks.c:215
0x6ffa74 gen_namespace_die
        /home/markus/gcc/gcc/dwarf2out.c:25009
0x6ffa74 gen_decl_die
        /home/markus/gcc/gcc/dwarf2out.c:25215
0x70078e dwarf2out_decl
        /home/markus/gcc/gcc/dwarf2out.c:25628
0x706c2f force_decl_die
        /home/markus/gcc/gcc/dwarf2out.c:24847
0x706de5 declare_in_namespace
        /home/markus/gcc/gcc/dwarf2out.c:24947
0x700127 declare_in_namespace
        /home/markus/gcc/gcc/dwarf2out.c:24918
0x700127 gen_decl_die
        /home/markus/gcc/gcc/dwarf2out.c:25116
0x70078e dwarf2out_decl
        /home/markus/gcc/gcc/dwarf2out.c:25628
0x700cde dwarf2out_function_decl
        /home/markus/gcc/gcc/dwarf2out.c:25643
0x7762ef rest_of_handle_final
        /home/markus/gcc/gcc/final.c:4506
0x7762ef execute
        /home/markus/gcc/gcc/final.c:4548
Please submit a full bug report,
Comment 1 Martin Liška 2016-12-20 16:46:02 UTC
Confirmed.
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

:(