https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103441
--- Comment #3 from hubicka at kam dot mff.cuni.cz --- > #0 gimple_set_bb (stmt=0x3fffb01a2be0, bb=0x0) at ../../gcc/gimple.c:1772 > #1 0x00000000107209b0 in gsi_remove (i=0x3fffffffd7c8, > remove_permanently=<optimized out>) at ../../gcc/gimple-iterator.c:569 > #2 0x0000000010bddd3c in remove_bb (bb=0x3fffb0de2698) at > ../../gcc/tree-cfg.c:2338 > #3 0x00000000104aa8a0 in delete_basic_block (bb=<optimized out>) at > ../../gcc/cfghooks.c:616 > #4 0x0000000010c087f4 in cleanup_control_flow_pre () at > ../../gcc/tree-cfgcleanup.c:979 > #5 0x0000000010c0b090 in cleanup_tree_cfg_noloop (ssa_update_flags=0) at > ../../gcc/tree-cfgcleanup.c:1073 > #6 cleanup_tree_cfg (ssa_update_flags=<optimized out>) at > ../../gcc/tree-cfgcleanup.c:1183 It is not safe to do cleanup_tree_cfg in IPA transform pass since it does not maintain cgraph edges (which are needed during inliing). There is delete_unreachable_blocks_update_callgraph.