public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/96900] [9/10/11 Regression] bogus -Warray-bounds on strlen with valid pointer obtained from just-past-the-end
Date: Wed, 02 Sep 2020 16:51:48 +0000	[thread overview]
Message-ID: <bug-96900-4-OvqSu2wsNO@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96900-4@http.gcc.gnu.org/bugzilla/>

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
      Known to fail|                            |10.2.0, 11.0, 9.3.0
            Summary|bogus -Warray-bounds on     |[9/10/11 Regression] bogus
                   |strlen with valid pointer   |-Warray-bounds on strlen
                   |obtained from               |with valid pointer obtained
                   |just-past-the-end           |from just-past-the-end

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
The false positive was introduced in r274837:

commit 14b7950f126f84fa585e3a057940ff10d4c5b3f8
Author: Martin Sebor <msebor@redhat.com>
Date:   Thu Aug 22 23:09:26 2019 +0000

    PR middle-end/91490 - bogus argument missing terminating nul warning on
strlen of a flexible array member

    gcc/c-family/ChangeLog:

            PR middle-end/91490
            * c-common.c (braced_list_to_string): Add argument and overload.
            Handle flexible length arrays and unions.

    gcc/ChangeLog:

            PR middle-end/91490
            * builtins.c (c_strlen): Rename argument and introduce new local.
            Set no-warning bit on original argument.
            * expr.c (string_constant): Pass argument type to
fold_ctor_reference.
            Fold empty and zero constructors into empty strings.
            * gimple-fold.c (fold_nonarray_ctor_reference): Return a STRING_CST
            for missing initializers.
            * tree.c (build_string_literal): Handle optional argument.
            * tree.h (build_string_literal): Add defaulted argument.
            * gimple-ssa-warn-restrict.c (maybe_diag_access_bounds): Check
            no-warning bit on original expression.

  reply	other threads:[~2020-09-02 16:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-02 16:50 [Bug middle-end/96900] New: " msebor at gcc dot gnu.org
2020-09-02 16:51 ` msebor at gcc dot gnu.org [this message]
2020-09-02 18:57 ` [Bug middle-end/96900] [9/10/11 Regression] " msebor at gcc dot gnu.org
2020-09-03  6:15 ` rguenth at gcc dot gnu.org
2020-09-03 23:37 ` msebor at gcc dot gnu.org
2021-01-14  9:19 ` rguenth at gcc dot gnu.org
2021-02-14  0:26 ` msebor at gcc dot gnu.org
2021-06-01  8:18 ` [Bug middle-end/96900] [9/10/11/12 " rguenth at gcc dot gnu.org
2022-05-27  9:43 ` [Bug middle-end/96900] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-07-07 10:38 ` [Bug middle-end/96900] [11/12/13/14 " rguenth 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-96900-4-OvqSu2wsNO@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).