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++/109299] [12 Regression] wrong warning on std::wstring with -O2 -std=c++20 -D_FORTIFY_SOURCE=2
Date: Tue, 28 Mar 2023 23:33:55 +0000	[thread overview]
Message-ID: <bug-109299-4-um1N2Efhd0@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109299-4@http.gcc.gnu.org/bugzilla/>

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

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

https://gcc.gnu.org/g:00ac6fa3f2a54fb9cc17b7b7f51eae3c6bf7a1bd

commit r12-9330-g00ac6fa3f2a54fb9cc17b7b7f51eae3c6bf7a1bd
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Mar 28 10:50:40 2023 +0100

    libstdc++: Tell GCC what basic_string::_M_is_local() means [PR109299]

    This avoids a bogus warning about overflowing a buffer, because GCC
    can't tell that we don't copy into the buffer unless it fits. By adding
    a __builtin_unreachable() hint we inform the compiler about the
    invariant that the buffer is only used when it's big enough.

    This can also improve codegen, by eliminating dead code that GCC
    couldn't tell was unreachable.

    libstdc++-v3/ChangeLog:

            PR libstdc++/109299
            * include/bits/basic_string.h (basic_string::_M_is_local()): Add
            hint for compiler that local strings fit in the local buffer.

    (cherry picked from commit bf78b43873b0b7e8f9a430df38749b8b61f9c9b8)

  parent reply	other threads:[~2023-03-28 23:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 15:01 [Bug libstdc++/109299] New: " benni.buch at gmail dot com
2023-03-27 15:38 ` [Bug tree-optimization/109299] " xry111 at gcc dot gnu.org
2023-03-27 20:57 ` redi at gcc dot gnu.org
2023-03-27 21:14 ` benni.buch at gmail dot com
2023-03-28  7:11 ` [Bug libstdc++/109299] [12/13 Regression] " rguenth at gcc dot gnu.org
2023-03-28  9:28 ` redi at gcc dot gnu.org
2023-03-28  9:37 ` redi at gcc dot gnu.org
2023-03-28  9:47 ` jakub at gcc dot gnu.org
2023-03-28 10:03 ` redi at gcc dot gnu.org
2023-03-28 10:05 ` redi at gcc dot gnu.org
2023-03-28 20:14 ` cvs-commit at gcc dot gnu.org
2023-03-28 23:33 ` cvs-commit at gcc dot gnu.org [this message]
2023-03-28 23:34 ` [Bug libstdc++/109299] [12 " 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-109299-4-um1N2Efhd0@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).