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++/100516] [11/12 Regression] Unexpected -Wstringop-overread in deque<char> initialization from empty initializer_list
Date: Thu, 27 Jan 2022 23:31:09 +0000	[thread overview]
Message-ID: <bug-100516-4-ockye0X8cV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100516-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 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:eae41b4d2cc30327f9f15c7390438c46aa09ed3f

commit r12-6907-geae41b4d2cc30327f9f15c7390438c46aa09ed3f
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jan 27 22:31:26 2022 +0000

    libstdc++: Prevent -Wstringop-overread warning in std::deque [PR100516]

    The compiler warns about the loop in deque::_M_range_initialize because
    it doesn't know that the number of nodes has already been correctly
    sized to match the size of the input. Use __builtin_unreachable to tell
    it that the loop will never be entered if the number of elements is
    smaller than a single node.

    libstdc++-v3/ChangeLog:

            PR libstdc++/100516
            * include/bits/deque.tcc (_M_range_initialize<ForwardIterator>):
            Add __builtin_unreachable to loop.
            * testsuite/23_containers/deque/100516.cc: New test.

  parent reply	other threads:[~2022-01-27 23:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11  9:26 [Bug c++/100516] New: " vopl at bk dot ru
2021-05-11  9:31 ` [Bug c++/100516] " vopl at bk dot ru
2021-05-11 13:49 ` vopl at bk dot ru
2021-05-11 16:12 ` [Bug c++/100516] [11 Regression] " msebor at gcc dot gnu.org
2021-07-06  6:45 ` [Bug c++/100516] [11/12 " rguenth at gcc dot gnu.org
2021-07-28  7:06 ` rguenth at gcc dot gnu.org
2022-01-20 13:53 ` [Bug libstdc++/100516] " rguenth at gcc dot gnu.org
2022-01-20 14:08 ` redi at gcc dot gnu.org
2022-01-20 15:47 ` msebor at gcc dot gnu.org
2022-01-27 22:39 ` redi at gcc dot gnu.org
2022-01-27 23:31 ` cvs-commit at gcc dot gnu.org [this message]
2022-04-12 21:13 ` [Bug libstdc++/100516] [11 " cvs-commit at gcc dot gnu.org
2022-04-12 21:14 ` 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-100516-4-ockye0X8cV@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).