https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91299
--- Comment #24 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:e5d24c4e89ae6d8c08f85f3425ea9c29dd0e6646 commit r12-11216-ge5d24c4e89ae6d8c08f85f3425ea9c29dd0e6646 Author: Richard Biener <rguent...@suse.de> Date: Fri Feb 28 14:09:29 2025 +0100 lto/91299 - weak definition inlined with LTO The following fixes a thinko in the handling of interposed weak definitions which confused the interposition check in get_availability by setting DECL_EXTERNAL too early. PR lto/91299 gcc/lto/ * lto-symtab.cc (lto_symtab_merge_symbols): Set DECL_EXTERNAL only after calling get_availability. gcc/testsuite/ * gcc.dg/lto/pr91299_0.c: New testcase. * gcc.dg/lto/pr91299_1.c: Likewise. (cherry picked from commit bc34db5b12e008f6ec4fdf4ebd22263c8617e5e3)