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 <mse...@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 via email to