On 27/04/19 12:03 +0200, Marc Glisse wrote:
Hello,

this small patch feels safe: we are moving an existing object to an uninitialized location so the 2 locations can't overlap. And it helps with std::vector<std::unique_ptr<int>> where it lets the compiler get rid of the branches "if(...) delete ..." when moving elements around, for instance in reserve(). We don't get a call to memmove yet (ldist may be confused by clobbers, I'll investigate and report that later), but the code gets much smaller at -O2, and we vectorize at -O3.

Similarly, I think the call to memmove in __relocate_a_1 could probably be memcpy (I don't remember why I chose memmove), but that seems less important and I don't want to mix it with this patch.

Bootstrap+regtest on x86_64-pc-linux-gnu.

OK for trunk, thanks.


Reply via email to