[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

euloanty at live dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 24 23:01:00 GMT 2019


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

--- Comment #10 from fdlbxtqi <euloanty at live dot com> ---
(In reply to fdlbxtqi from comment #9)
> (In reply to Marc Glisse from comment #8)
> > (In reply to fdlbxtqi from comment #6)
> > > void copy_char_vector_with_iter(std::vector<char8_t>::iterator
> > > out,std::vector<char> const& bits)
> > > {
> > > 	std::copy_n(bits.begin(),bits.size(),out);
> > > }
> > > 
> > > https://godbolt.org/z/_yA_Ls
> > > See the assembly
> > 
> > Thanks, I just filed PR 93063 about a subpart that the compiler should be
> > able to do without help from the library.
> 
> I have tried the same benchmark on clang. It has the same issue. However,
> GCC's optimization of this would inspire Clang I believe.

and libc++


More information about the Gcc-bugs mailing list