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

--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <[email protected]>:

https://gcc.gnu.org/g:79e29562907b454cdb867195b34cf63156d2d0cc

commit r17-570-g79e29562907b454cdb867195b34cf63156d2d0cc
Author: Avi Kivity <[email protected]>
Date:   Thu Feb 26 19:59:41 2026 +0200

    libstdc++: optimize std::uninitialized_move{,_n}() to memcpy when possible
[PR121789]

    std::uninitialized_move{,_n} delegates to the corresponding
    std::uninitialized_copy() variant after wrapping with a move
    iterator, but the std::uninitialized_copy() doesn't unwrap the
    move iterator, therefore losing the memcpy optimization if the
    iterators were just pointers.

    Fix this by unwrapping the move iterator using  __miter_base().

    We remove operator-() in testsuite_greedy_ops.h; otherwise it breaks
    the range size computation.

    libstdc++v3/Changelog:

            PR libstdc++/121789
            * include/bits/stl_uninitialized.h (uninitialized_copy):
            Unwrap move iterators
            *
testsuite/20_util/specialized_algorithms/uninitialized_move/121789.cc:
            New test.
            * testsuite/util/testsuite_greedy_ops.h (greedy_ops): Comment
            out operator-(T, T).
  • [Bug libstdc++/121789] std:unin... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to