https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94295
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> --- (In reply to Richard Smith from comment #0) > The C++ language rules do not permit optimization (eg, deletion) of direct > calls to 'operator new' and 'operator delete'. I thought that was considered a bug? Gcc does optimize those, like it does malloc/free... > This bug requests that libstdc++ uses these builtins when available. So just in std::allocator, or are there other places? > (Separately, it'd be great if GCC considered supporting them too.) IIRC (would need to dig up the conversation), when the optimization for new/delete pairs was added in gcc, the builtin option was rejected.