public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/100387] ranges::minmax compares moved-out value
Date: Tue, 12 Oct 2021 18:37:41 +0000	[thread overview]
Message-ID: <bug-100387-4-rjxbPvbhjr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100387-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:1335d35a530f31f60874cea1d5c98de81deed335

commit r10-10196-g1335d35a530f31f60874cea1d5c98de81deed335
Author: Patrick Palka <ppalka@redhat.com>
Date:   Fri Jun 18 19:33:39 2021 -0400

    libstdc++: Reduce ranges::minmax/minmax_element comparison complexity

    This rewrites ranges::minmax and ranges::minmax_element so that it
    performs at most 3*N/2 many comparisons, as required by the standard.
    In passing, this also fixes PR100387 by avoiding a premature std::move
    in ranges::minmax and in std::shift_right.

            PR libstdc++/100387

    libstdc++-v3/ChangeLog:

            * include/bits/ranges_algo.h (__minmax_fn::operator()): Rewrite
            to limit comparison complexity to 3*N/2.
            (__minmax_element_fn::operator()): Likewise.
            (shift_right): Avoid premature std::move of __result.
            * testsuite/25_algorithms/minmax/constrained.cc (test04, test05):
            New tests.
            * testsuite/25_algorithms/minmax_element/constrained.cc (test02):
            Likewise.

    (cherry picked from commit cc9c94d43dcfa98436152af9c00f011e9dab25f6)

  parent reply	other threads:[~2021-10-12 18:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 16:54 [Bug libstdc++/100387] New: " hewillk at gmail dot com
2021-05-02 17:11 ` [Bug libstdc++/100387] " hewillk at gmail dot com
2021-05-03 14:08 ` ppalka at gcc dot gnu.org
2021-05-04 14:45 ` ppalka at gcc dot gnu.org
2021-06-18 23:34 ` cvs-commit at gcc dot gnu.org
2021-07-13 14:03 ` cvs-commit at gcc dot gnu.org
2021-10-12 18:37 ` cvs-commit at gcc dot gnu.org [this message]
2021-10-12 18:40 ` ppalka at gcc dot gnu.org
2021-10-12 18:59 ` ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100387-4-rjxbPvbhjr@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).