https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100308
Bug ID: 100308 Summary: IPA CP ipcp_modif_dom_walker removes calls w/o updating the cgraph Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org CC: marxin at gcc dot gnu.org Target Milestone: --- There's now (after a patch I have to commit) FAIL: gfortran.dg/gomp/pr88933.f90 -O (internal compiler error) FAIL: gfortran.dg/gomp/pr88933.f90 -O (test for excess errors) /home/rguenther/src/gcc3/gcc/testsuite/gfortran.dg/gomp/pr88933.f90:11:14: Error: edge b.constprop->__builtin_free has no corresponding call_stmt # _18 = VDEF <.MEM_16(D)> __builtin_free (l_14(D)); b.1.constprop.0/15 (b.constprop) @0x7ffff6753ee0 Type: function definition analyzed Visibility: artificial References: Referring: Availability: local Function flags: count:1073741824 (estimated locally) body local Called by: a.0/0 (1073741824 (estimated locally),1.00 per call) (can throw external) Calls: memset/12 (445388112 (estimated locally),0.41 per call) free/14 (0 (precise),0.00 per call) during IPA pass: inline dump file: pr88933.f90.083i.inline /home/rguenther/src/gcc3/gcc/testsuite/gfortran.dg/gomp/pr88933.f90:11:14: internal compiler error: verify_cgraph_node failed 0xd5f3aa cgraph_node::verify_node() /home/rguenther/src/gcc3/gcc/cgraph.c:3829 0xd46003 symtab_node::verify() /home/rguenther/src/gcc3/gcc/symtab.c:1356 0x14a8909 optimize_inline_calls(tree_node*) /home/rguenther/src/gcc3/gcc/tree-inline.c:5494 0x10a1640 inline_transform(cgraph_node*) which is because in ipcp_modif_dom_walker::before_dom_children we do *m_something_changed = true; if (maybe_clean_eh_stmt (stmt) && gimple_purge_dead_eh_edges (gimple_bb (stmt))) *m_cfg_changed = true; which ends up wiping a BB containing a call (the function does remove_edge_and_dominated_blocks). We do seem to be setup to deal with "other" parts as in the caller we do if (cfg_changed) delete_unreachable_blocks_update_callgraph (node, false); the twist is that gimple_purge_dead_eh_edges wouldn't actually remove dominated blocks if dominator info isn't available (but of course it is in this case). The issue is obviously latent.