https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117047
--- Comment #38 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #34) > 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. ggc_free is really large, is that fnsplit that inlines just the if (in_gcc) return; part of it or something similar? I think noinline attribute on ggc_free wouldn't be a bad idea.