https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92023
--- Comment #10 from Richard Biener <rguenth at gcc dot gnu.org> --- I think we should try to behave better by default here, for QOI reasons. I'm not sure the implementation is conforming. As for how to improve our standard behavior it might be possible to simply ignore a (implicit) malloc attribute for functions which we have a definition for (once we stream PTA info we have to be careful with LTO here). This wouldn't be enough if only operator delete[] would have a visible difinition but not operator new[] - but at least for C++ it might be possible to connect both, thus look up a corresponding operator delete[] or have the frontend set some flag on the availability. Alternatively to ignoring malloc we could slap 'noipa' on those operators. Though of course they might simply wrappers around global new/delete. IIRC we do have documentation on issues with malloc/free implementations being visible.