https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92300
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- Created attachment 51924 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51924&action=edit Patch to avoid creating a node if inserting something key-like into a map This avoids the allocate/deallocate pair for the failed insertion in your original example.