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++/104719] Use of `std::move` in libstdc++ leads to worsened debug performance
Date: Wed, 04 May 2022 15:34:43 +0000	[thread overview]
Message-ID: <bug-104719-4-4TkRVPqnsJ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-104719-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:ef8d5ac08b5e60f35c52087d88c0235c8ce6b65b

commit r13-113-gef8d5ac08b5e60f35c52087d88c0235c8ce6b65b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Mar 25 10:28:28 2022 +0000

    libstdc++: Simplify std::array accessors [PR104719]

    This removes the __array_traits::_S_ref and __array_traits::_S_ptr
    accessors, which only exist to make the special case of std::array<T, 0>
    syntactically well-formed.

    By changing the empty type used as the std::array<T, 0>::_M_elems data
    member to support operator[] and conversion to a pointer, we can write
    code using the natural syntax. The indirection through _S_ref and
    _S_ptr is removed for the common case, and a function call is only used
    for the special case of zero-size arrays.

    The invalid member access for zero-sized arrays is changed to use
    __builtin_trap() instead of a null dereference. This guarantees a
    runtime error if it ever gets called, instead of undefined behaviour
    that is likely to get optimized out as unreachable.

    libstdc++-v3/ChangeLog:

            PR libstdc++/104719
            * include/std/array (__array_traits::_S_ref): Remove.
            (__array_traits::_S_ptr): Remove.
            (__array_traits<T, 0>::_Type): Define operator[] and operator T*
            to provide an array-like API.
            (array::_AT_Type): Remove public typeef.
            (array::operator[], array::at, array::front, array::back): Use
            index operator to access _M_elems instead of _S_ref.
            (array::data): Use implicit conversion from _M_elems to pointer.
            (swap(array&, array&)): Use __enable_if_t helper.
            (get<I>): Use index operator to access _M_elems.
            * testsuite/23_containers/array/tuple_interface/get_neg.cc:
            Adjust dg-error line numbers.

  parent reply	other threads:[~2022-05-04 15:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 16:20 [Bug libstdc++/104719] New: " vittorio.romeo at outlook dot com
2022-02-28 16:46 ` [Bug libstdc++/104719] " redi at gcc dot gnu.org
2022-02-28 16:50 ` redi at gcc dot gnu.org
2022-02-28 16:56 ` egallager at gcc dot gnu.org
2022-02-28 17:00 ` vittorio.romeo at outlook dot com
2022-02-28 17:16 ` redi at gcc dot gnu.org
2022-02-28 17:20 ` vittorio.romeo at outlook dot com
2022-02-28 17:24 ` redi at gcc dot gnu.org
2022-02-28 17:37 ` redi at gcc dot gnu.org
2022-03-01  2:23 ` vittorio.romeo at outlook dot com
2022-03-01 20:12 ` redi at gcc dot gnu.org
2022-03-01 20:14 ` redi at gcc dot gnu.org
2022-03-10 23:04 ` jason at gcc dot gnu.org
2022-03-26 23:37 ` jason at gcc dot gnu.org
2022-03-27  7:35 ` redi at gcc dot gnu.org
2022-05-04 15:34 ` cvs-commit at gcc dot gnu.org [this message]
2022-05-04 15:34 ` cvs-commit at gcc dot gnu.org
2022-05-04 15:49 ` unlvsur at live dot com
2022-05-04 15:55 ` redi 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-104719-4-4TkRVPqnsJ@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).