https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107944
--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Martin Jambor <jamb...@gcc.gnu.org>: https://gcc.gnu.org/g:8495d80f44488b2566afc84b3f5704dd7c999e21 commit r12-9096-g8495d80f44488b2566afc84b3f5704dd7c999e21 Author: Martin Jambor <mjam...@suse.cz> Date: Wed Feb 1 18:58:09 2023 +0100 ipa: Release body more carefully when removing nodes (PR 107944) The code removing function bodies when the last call graph clone of a node is removed is too aggressive when there are nodes up the clone_of chain which still need them. Fixed by expanding the check. gcc/ChangeLog: 2023-01-18 Martin Jambor <mjam...@suse.cz> PR ipa/107944 * cgraph.cc (cgraph_node::remove): Check whether nodes up the lcone_of chain also do not need the body. (cherry picked from commit db959e250077ae6b4fc08f53fb322719582c5de6)