https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77905
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So, what happens is that #0 set_const_flag_1 (node=<cgraph_node* 0x7ffff173b000 "_GLOBAL__sub_I_A">, set_const=true, looping=false, changed=0x7fffffffdd5f) at ../../gcc/cgraph.c:2469 #1 0x0000000000ba53ef in cgraph_node::set_const_flag (this=<cgraph_node* 0x7ffff173b000 "_GLOBAL__sub_I_A">, set_const=true, looping=false) at ../../gcc/cgraph.c:2575 #2 0x0000000001b25d6b in propagate_pure_const () at ../../gcc/ipa-pure-const.c:1499 #3 0x0000000001b26355 in (anonymous namespace)::pass_ipa_pure_const::execute (this=0x29b9650) at ../../gcc/ipa-pure-const.c:1678 clears DECL_STATIC_CONSTRUCTOR flag on a artificial static ctor _GLOBAL__sub_I_A, because the ctor isn't actually needed. And then we hit: tree *val = map.get (symbol); /* A NULL here means that SYMBOL is unreachable in the definition of ipa-comdats. Either ipa-comdats is wrong about this or someone forgot to cleanup and remove unreachable functions earlier. */ gcc_assert (val); clearly it is the second case, "someone forgot to cleanup and remove unreachable functions earlier".