https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79760
Bug ID: 79760 Summary: ICE in type_in_anonymous_namespace_p in ipa-utils.h:219 Product: gcc Version: 7.0 URL: https://bugzilla.opensuse.org/show_bug.cgi?id=1026915 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: hubicka at ucw dot cz Target Milestone: --- Target: avr-linux-gnu Hello. This bug comes from openSUSE bugzilla, where we ICE in cross-avr compiler: ~/Programming/gcc3/objdir/gcc/lto1 -mno-skip-bug -quiet -dumpdir ./ -dumpbase application.elf.wpa -mn-flash=1 -mmcu=avr5 -mn-flash=1 -mno-skip-bug -mmcu=avr5 -auxbase application-main -g -Os -version -fltrans-output-list=application.elf.ltrans.out -fwpa -fresolution=my.res -flinker-output=exec application-main.o gate.o gate_debounce.o GNU GIMPLE (GCC) version 6.3.1 20170228 (avr-elf) compiled by GNU C version 6.3.1 20170202 [gcc-6-branch revision 245119], GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.3, isl version 0.15 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU GIMPLE (GCC) version 6.3.1 20170228 (avr-elf) compiled by GNU C version 6.3.1 20170202 [gcc-6-branch revision 245119], GMP version 6.1.2, MPFR version 3.1.5, MPC version 1.0.3, isl version 0.15 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 lto1: internal compiler error: Segmentation fault 0xbf0a76 crash_signal ../../gcc/toplev.c:333 0x730068 type_in_anonymous_namespace_p(tree_node const*) ../../gcc/ipa-utils.h:219 0x9d4822 maybe_record_node ../../gcc/ipa-devirt.c:2467 0x9d5cb0 possible_polymorphic_call_targets(tree_node*, long, ipa_polymorphic_call_context, bool*, void**, bool) ../../gcc/ipa-devirt.c:3186 0x7d9148 possible_polymorphic_call_targets(cgraph_edge*, bool*, void**, bool) ../../gcc/ipa-utils.h:115 0xa0e89a walk_polymorphic_call_targets ../../gcc/ipa.c:167 0xa0f34a symbol_table::remove_unreachable_nodes(_IO_FILE*) ../../gcc/ipa.c:428 0xb2aa7e execute_todo ../../gcc/passes.c:2024 where: $ (gdb) p debug_tree(target) <function_decl 0x7ffff692f9a0 __cxa_pure_virtual type <function_type 0x7ffff6935c78 type <void_type 0x7ffff6886150 void VOID align 8 symtab 0 alias set -1 structural equality pointer_to_this <pointer_type 0x7ffff68862a0>> QI size <integer_cst 0x7ffff6876a20 constant 8> unit size <integer_cst 0x7ffff6876a38 constant 1> align 8 symtab 0 alias set -1 structural equality arg-types <tree_list 0x7ffff6879ac8 value <void_type 0x7ffff6886150 void>> pointer_to_this <pointer_type 0x7ffff6935e70>> readonly addressable nothrow static function-specific-opt HI file gate.cpp line 21 col 17 align 8 context <translation_unit_decl 0x7ffff6931078 D.1479>> (gdb) p e->caller->debug() _ZN4Gate11maybeReEvalEv/5 (maybeReEval) @0x7ffff693d170 Type: function definition analyzed Visibility: prevailing_def_ironly Aux: @0x7ffff6934480 References: Referring: Read from file: application-main.o Availability: local First run: 0 Function flags: local optimize_size Called by: main/12 (100.00 per call) Calls: Polymorphic indirect call of type struct Gate token:0(0.39 per call) of param:0 Outer type (dynamic):struct Gate (or a derived type) offset 0 One can debug that with gcc-6-branch and ../configure --target=avr-elf --enable-languages=c,c++ It's not trivial to provide all cross libc, bintuils, etc. I'll attach the 3 objects and: $ cat my.res 3 application-main.o 16 258 478ff6477416a70d PREVAILING_DEF_IRONLY global_error 209 478ff6477416a70d PREVAILING_DEF_IRONLY _ZN4Gate11maybeReEvalEv 215 478ff6477416a70d PREVAILING_DEF_IRONLY _Z22register_for_pinchangehP4Gate 219 478ff6477416a70d PREVAILING_DEF_IRONLY _Z9unmarshalv 260 478ff6477416a70d PREVAILING_DEF_IRONLY n_gates 267 478ff6477416a70d PREVAILING_DEF_IRONLY gate_array 222 478ff6477416a70d PREVAILING_DEF main 270 478ff6477416a70d PREVAILING_DEF_IRONLY soft_IFR 272 478ff6477416a70d PREVAILING_DEF_IRONLY maskC 274 478ff6477416a70d PREVAILING_DEF_IRONLY maskB 280 478ff6477416a70d PREVAILING_DEF_IRONLY portvalC 282 478ff6477416a70d PREVAILING_DEF_IRONLY portvalB 278 478ff6477416a70d UNDEF mem_address 242 478ff6477416a70d RESOLVED_IR _ZN9DebouncerC1Ev 253 478ff6477416a70d RESOLVED_IR _Znwj 256 478ff6477416a70d RESOLVED_IR _Z15eeprom_get_bytev gate.o 3 206 5bdf351e009d9cff PREVAILING_DEF_IRONLY _ZN4Gate7timeoutEv 209 5bdf351e009d9cff PREVAILING_DEF_IRONLY __cxa_pure_virtual 196 5bdf351e009d9cff PREVAILING_DEF_IRONLY _ZTV4Gate gate_debounce.o 7 220 f5c19cd596cdbebb PREVAILING_DEF_IRONLY _ZN9Debouncer4evalEv 223 f5c19cd596cdbebb PREVAILING_DEF_IRONLY _ZN9DebouncerC2Ev 209 f5c19cd596cdbebb PREVAILING_DEF_IRONLY _ZTV9Debouncer 226 f5c19cd596cdbebb PREVAILING_DEF_IRONLY _ZN9DebouncerC1Ev 232 f5c19cd596cdbebb RESOLVED_IR _ZN4Gate7timeoutEv 238 f5c19cd596cdbebb RESOLVED_IR _Z22register_for_pinchangehP4Gate 242 f5c19cd596cdbebb RESOLVED_IR _Z15eeprom_get_bytev