This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/68350] std::uninitialized_copy overly restrictive for trivially_copyable types
- From: "ville.voutilainen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 16 Dec 2015 17:37:14 +0000
- Subject: [Bug libstdc++/68350] std::uninitialized_copy overly restrictive for trivially_copyable types
- Auto-submitted: auto-generated
- References: <bug-68350-4 at http dot gcc dot gnu dot org/bugzilla/>
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.