https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110137
--- Comment #20 from Richard Biener <rguenth at gcc dot gnu.org> --- Whether a call clobbers or uses memory is controlled by fnspec these days and a malloc attribute does _not_ indicate this. It works for malloc/free because we make it so via the builtins in builtin_fnspec where the C++ new/delete expressions are handled in gimple_call_fnspec (but not indicating not using/clobbering global memory). Note we do treat C++ delete as not escaping the pointer and only writing to it and not reading. It still uses/clobbers global memory though.