https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105399
Bug ID: 105399
Summary: [12 Regression] -O2/-Ofast -flto ICEs as internal
compiler error: verify_cgraph_node failed
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
Assignee: unassigned at gcc dot gnu.org
Reporter: slyfox at gcc dot gnu.org
CC: marxin at gcc dot gnu.org
Target Milestone: ---
Found as an ICE on ncnn project. Minimized example:
// cat bug.cpp.cpp
struct S {
S();
};
S::S() {}
$ g++ -fPIC -flto -Ofast -o bug.o -c bug.cpp.cpp
$ g++ -fPIC -flto -O2 -shared -o libncnn.so bug.o
lto1: error: semantic interposition mismatch
_ZN1SC1Ev/2 (__ct_comp ) @0x7f8bd1e14110
Type: function definition analyzed alias
Visibility: externally_visible prevailing_def_ironly_exp public
References: _ZN1SC2Ev/1 (alias)
Referring:
Read from file: bug.o
Unit id: 1
Function flags:
Called by:
Calls:
during IPA pass: modref
lto1: internal compiler error: verify_cgraph_node failed
0x97eec0 cgraph_node::verify_node()
../../gcc-12-20220424/gcc/cgraph.cc:3874
0x96eb84 symtab_node::verify()
../../gcc-12-20220424/gcc/symtab.cc:1359
0x96fcf7 symtab_node::verify_symtab_nodes()
../../gcc-12-20220424/gcc/symtab.cc:1387
0xc13224 symtab_node::checking_verify_symtab_nodes()
../../gcc-12-20220424/gcc/cgraph.h:682
0xc13224 symbol_table::remove_unreachable_nodes(_IO_FILE*)
../../gcc-12-20220424/gcc/ipa.cc:679
0x8f57f5 read_cgraph_and_symbols(unsigned int, char const**)
../../gcc-12-20220424/gcc/lto/lto-common.cc:2960
0x8dcdb2 lto_main()
../../gcc-12-20220424/gcc/lto/lto.cc:626
$ g++ -v
Using built-in specs.
COLLECT_GCC=/<<NIX>>/gcc-debug-12.0.0/bin/g++
COLLECT_LTO_WRAPPER=/<<NIX>>/gcc-debug-12.0.0/libexec/gcc/x86_64-unknown-linux-gnu/12.0.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with:
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.1 20220424 (experimental) (GCC)