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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Martin Sebor <mse...@gcc.gnu.org>:

https://gcc.gnu.org/g:8bf5b49ebd2176b8c535147377381dd07fbdd643

commit r12-2422-g8bf5b49ebd2176b8c535147377381dd07fbdd643
Author: Martin Sebor <mse...@redhat.com>
Date:   Tue Jul 20 13:48:20 2021 -0600

    Correct stpcpy offset computation for -Warray-bounds et al. [PR101397].

    Resolves:
    PR middle-end/101397 - spurious warning writing to the result of stpcpy
minus 1

    gcc/ChangeLog:

            PR middle-end/101397
            * builtins.c (gimple_call_return_array): Add argument.  Correct
            offsets for memchr, mempcpy, stpcpy, and stpncpy.
            (compute_objsize_r): Adjust offset computation for argument
returning
            built-ins.

    gcc/testsuite/ChangeLog:

            PR middle-end/101397
            * gcc.dg/Warray-bounds-80.c: New test.
            * gcc.dg/Warray-bounds-81.c: New test.
            * gcc.dg/Warray-bounds-82.c: New test.
            * gcc.dg/Warray-bounds-83.c: New test.
            * gcc.dg/Warray-bounds-84.c: New test.
            * gcc.dg/Wstringop-overflow-46.c: Adjust expected output.

Reply via email to