https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87604
Bug ID: 87604 Summary: memmove without std::allocator Product: gcc Version: 9.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: glisse at gcc dot gnu.org Target Milestone: --- The current overload of __uninitialized_copy_a that eventually dispatches to a call to memmove is restricted to std::allocator. However, it should also be valid for a number of other allocators. Libc++ has a trick where it detects allocators that do not provide construct() and thus use the one from allocator_traits. I expect most custom C++11 allocators redefine allocation but not construction, so this seems like a useful extension of the special case. (this will become less important at -O3 if PR 86024 gets implemented) (If the relocation patch is approved, that version may also need to check destroy())