https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117047
--- Comment #34 from Andrew Pinski <pinskia at gcc dot gnu.org> --- from ggc.h: ``` /* The internal primitive. */ extern void *ggc_internal_alloc (size_t, void (*)(void *), size_t, size_t CXX_MEM_STAT_INFO) ATTRIBUTE_MALLOC; ... /* Allocates cleared memory. */ extern void *ggc_internal_cleared_alloc (size_t, void (*)(void *), size_t, size_t CXX_MEM_STAT_INFO) ATTRIBUTE_MALLOC; ``` I am not 100% sure that is valid with LTO especially if ggc_free can be inlined. a simple test is to mark ggc_free as noinline (or noipa) or remove the ATTRIBUTE_MALLOC usage from ggc.h header file.