public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/49559] [C++0x] stable_sort calls self-move-assignment operator
Date: Tue, 28 Jun 2011 18:07:00 -0000	[thread overview]
Message-ID: <bug-49559-4-kkArqYZ5sM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-49559-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49559

--- Comment #12 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-06-28 18:06:54 UTC ---
I'm looking at __merge_adaptive and it seems to me that self move assignment
can happen very generically. Consider:

 if (__len1 <= __len2 && __len1 <= __buffer_size)
   {
     _Pointer __buffer_end = _GLIBCXX_MOVE3(__first, __middle, __buffer);
     std::__move_merge(__buffer, __buffer_end, __middle, __last, __first);
   }

here __first comes in memory before __middle and when __move_merge has filled
all the positions before __middle then any element can be move assigned from
itself. Of course we could always move to the buffer the entire range __first,
__last. Still looking for Chris' opinion on this, he updated this code to move
instead of copy...


  parent reply	other threads:[~2011-06-28 18:07 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-28  6:56 [Bug libstdc++/49559] New: " joerg.richter@pdv-fs.de
2011-06-28  8:41 ` [Bug libstdc++/49559] " redi at gcc dot gnu.org
2011-06-28  8:56 ` redi at gcc dot gnu.org
2011-06-28  9:45 ` paolo.carlini at oracle dot com
2011-06-28  9:49 ` paolo.carlini at oracle dot com
2011-06-28 10:41 ` [Bug libstdc++/49559] [C++0x] " paolo.carlini at oracle dot com
2011-06-28 10:46 ` redi at gcc dot gnu.org
2011-06-28 10:57 ` paolo.carlini at oracle dot com
2011-06-28 10:59 ` paolo.carlini at oracle dot com
2011-06-28 13:38 ` paolo.carlini at oracle dot com
2011-06-28 14:12 ` paolo.carlini at oracle dot com
2011-06-28 14:12 ` paolo.carlini at oracle dot com
2011-06-28 16:23 ` paolo.carlini at oracle dot com
2011-06-28 18:07 ` paolo.carlini at oracle dot com [this message]
2011-06-28 19:16 ` chris at bubblescope dot net
2011-06-28 19:39 ` paolo.carlini at oracle dot com
2011-07-07  9:54 ` paolo.carlini at oracle dot com
2011-07-08 11:01 ` paolo.carlini at oracle dot com
2011-07-08 11:47 ` paolo.carlini at oracle dot com
2011-07-08 15:47 ` paolo.carlini at oracle dot com
2011-07-08 16:23 ` paolo.carlini at oracle dot com
2011-07-11 18:40 ` paolo at gcc dot gnu.org
2011-07-11 18:43 ` paolo.carlini at oracle dot com
2011-07-13 15:14 ` joerg.richter@pdv-fs.de
2011-07-13 15:20 ` paolo.carlini at oracle dot com
2011-09-27  8:31 ` paolo.carlini at oracle dot com
2011-09-27  8:31 ` paolo 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-49559-4-kkArqYZ5sM@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).