https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113996
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Eric Botcazou <ebotca...@gcc.gnu.org>: https://gcc.gnu.org/g:65073a5b90c00a1c47efae8a67b9c754e2287ee0 commit r15-3979-g65073a5b90c00a1c47efae8a67b9c754e2287ee0 Author: Eric Botcazou <ebotca...@adacore.com> Date: Mon Sep 30 21:04:18 2024 +0200 Fix internal error during inlining after ICF pass The problem is that the ICF pass identifies two functions, one of which has a static chain while the other does not. The fix is simply to prevent this identification from occurring. gcc/ PR ipa/113996 * ipa-icf.cc (sem_function::get_hash): Hash DECL_STATIC_CHAIN. (sem_function::equals_wpa): Compare it. (sem_function::equals_private): Likewise. gcc/testsuite/ * gnat.dg/lto27.adb: New test.