https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122852
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Josef Melcr <[email protected]>: https://gcc.gnu.org/g:c157eca33eb0098df1dc715c19672e923f4d2d98 commit r16-6800-gc157eca33eb0098df1dc715c19672e923f4d2d98 Author: Josef Melcr <[email protected]> Date: Mon Dec 8 15:35:33 2025 +0100 ipa/122852: Don't delete unreachable callback edges. Hi, previously, callback edges of a carrying edge redirected to __builtin_unreachable were deleted, as I thought they would mess with the callgraph, given that they were no longer correct. In some cases, the edges would be deleted when duplicating a fn summary, producing a segfault. This patch changes this behavior. It redirects the callback edges to __builtin_unreachable and adds an exception for such cases in the verifier. Callback edges are now also required to point to __builtin_unreachable if their carrying edge is pointing to __builtin_unreachable. Bootstrapped and regtested on x86_64-linux, no regressions. OK for master? Thanks, Josef PR ipa/122852 gcc/ChangeLog: * cgraph.cc (cgraph_node::verify_node): Verify that callback edges are unreachable when the carrying edge is unreachable. * ipa-fnsummary.cc (redirect_to_unreachable): Redirect callback edges to unreachable when redirecting the carrying edge. libgomp/ChangeLog: * testsuite/libgomp.c/pr122852.c: New test. Signed-off-by: Josef Melcr <[email protected]>
