https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88220
Bug ID: 88220 Summary: lto1: fatal error: Cgraph edge statement index out of range Product: gcc Version: 9.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: lto Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- It's very old issue, isolated from libfakechroot package: $ cat open64.i void a() __asm__("open64"); void b(); void c(); void a() { b(); c(); } extern __inline __attribute__((__gnu_inline__)) void open64() {} struct { void (*d) (void); } e = {open64}; $ gcc -flto open64.i -shared -fPIC -O In function ‘a’: lto1: fatal error: Cgraph edge statement index out of range compilation terminated. lto-wrapper: fatal error: gcc returned 1 exit status compilation terminated. /usr/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status And one very similar test-case: $ cat open64-2.i void a() __asm__("open64"); void b(); void c(); void a() { b(); c(); } extern __inline __attribute__((__gnu_inline__)) int open64() {} struct { int (*d) (void); } e = {open64}; $ gcc -flto open64-2.i -shared -fPIC -O lto1: internal compiler error: in wide_int_to_tree_1, at tree.c:1561 0x6bed2b wide_int_to_tree_1 /home/marxin/Programming/gcc/gcc/tree.c:1561 0xabebaf lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) /home/marxin/Programming/gcc/gcc/lto-streamer-in.c:1517 0xabebaf lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) /home/marxin/Programming/gcc/gcc/lto-streamer-in.c:1483 0xabed60 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*) /home/marxin/Programming/gcc/gcc/lto-streamer-in.c:1438 0xabedcc lto_input_tree(lto_input_block*, data_in*) /home/marxin/Programming/gcc/gcc/lto-streamer-in.c:1541 0xac0e23 input_function /home/marxin/Programming/gcc/gcc/lto-streamer-in.c:1043 0xac0e23 lto_read_body_or_constructor /home/marxin/Programming/gcc/gcc/lto-streamer-in.c:1295 0x819854 cgraph_node::get_untransformed_body() /home/marxin/Programming/gcc/gcc/cgraph.c:3545 0x825939 cgraph_node::expand() /home/marxin/Programming/gcc/gcc/cgraphunit.c:2166 0x8269d3 expand_all_functions /home/marxin/Programming/gcc/gcc/cgraphunit.c:2334 0x8269d3 symbol_table::compile() /home/marxin/Programming/gcc/gcc/cgraphunit.c:2685 0x78e219 lto_main() /home/marxin/Programming/gcc/gcc/lto/lto.c:3389