[Bug libstdc++/93059] char and char8_t does not talk with each other with memcpy. std::copy std::copy_n, std::fill, std::fill_n, std::uninitialized_copy std::uninitialized_copy_n, std::fill, std::uninitialized_fill_n fails to convert to memxxx functions

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 24 09:54:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93059

--- Comment #5 from Marc Glisse <glisse at gcc dot gnu.org> ---
We could indeed relax a bit the "same type" condition. We could also make sure
that __restrict appears somewhere in the call chain when using copy or
uninitialized_*, which lets the compiler merge the 2 loads/stores.

(In reply to fdlbxtqi from comment #2)
> The last 2nd line return __dst is wrong. It should not exist.

Write a patch, test it, and send it to the mailing list?

(In reply to fdlbxtqi from comment #3)
> For vector, the performance lost is even worse. It generates 96 lines of
> assembly for different types since it does not call memmove.

What operation are you doing on vector? None of your testcases seem to use it.

> clearly incorrect

Please distinguish between what is wrong (generated code crashes, or returns 3
instead of 2), and what is suboptimal.


More information about the Gcc-bugs mailing list