https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116572
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Martin Jambor <jamb...@gcc.gnu.org>: https://gcc.gnu.org/g:5312a8f62a6bcae36f6aa40f88c8b58dfae7db21 commit r14-11495-g5312a8f62a6bcae36f6aa40f88c8b58dfae7db21 Author: Martin Jambor <mjam...@suse.cz> Date: Fri Mar 14 16:07:01 2025 +0100 ipa: Do not modify cgraph edges from thunk clones during inlining (PR116572) In PR 116572 we hit an assert that a thunk which does not have a body looks like it has one. It does not, but the call_stmt of its outgoing edge points to a statement, which should not. In fact it has several outgoing call graph edges, which cannot be. The problem is that the code updating the edges to reflect inlining into the master clone (an ex-thunk, unlike the clone, which is still an unexpanded thunk) is being updated during inling into the master clone. This patch simply makes the code to skip unexpanded thunk clones. gcc/ChangeLog: 2025-03-13 Martin Jambor <mjam...@suse.cz> PR ipa/116572 * cgraph.cc (cgraph_update_edges_for_call_stmt): Do not update edges of clones that are unexpanded thunk. Assert that the node passed as the parameter is not an unexpanded thunk. gcc/testsuite/ChangeLog: 2025-03-13 Martin Jambor <mjam...@suse.cz> PR ipa/116572 * g++.dg/ipa/pr116572.C: New test. (cherry picked from commit 075ec330307c5b1fe5ed166a633c718c06b01437)