This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/68350] std::uninitialized_copy overly restrictive for trivially_copyable types


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

Ville Voutilainen <ville.voutilainen at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |7.0
           Severity|normal                      |enhancement

--- Comment #4 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
To elaborate on what Jonathan said: std::uninitialized_copy currently calls
std::copy for the trivial cases. std::copy should require assignability;
std::unitialized_copy wouldn't need to. We need to introduce a new low-level
function that does not perform the check, so that std::uninitialized_copy can
call it directly and std::copy can call it with a check. Furthermore, there
is a similar-ish optimization opportunity for std::uninitialized_fill and
std::uninitialized_fill_n (which currently call std::fill and std::fill_n, 
which should perform extra checks), those functions
would also benefit from yet another new low-level function.

After discussing this with Jonathan, we deemed it unsuitable for Stage 3.
I'll get back on this after we get to Stage 1 for gcc 7, chances are of course
that we can backport when the time comes.

Setting target milestone to 7 and changing importance to enhancement.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]