From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66ABB385AC23; Tue, 20 Jul 2021 19:52:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66ABB385AC23 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/101397] [11/12 Regression] spurious warning writing to the result of stpcpy minus 1 Date: Tue, 20 Jul 2021 19:52:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: diagnostic, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: msebor at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jul 2021 19:52:17 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101397 --- Comment #4 from CVS Commits --- The master branch has been updated by Martin Sebor : https://gcc.gnu.org/g:8bf5b49ebd2176b8c535147377381dd07fbdd643 commit r12-2422-g8bf5b49ebd2176b8c535147377381dd07fbdd643 Author: Martin Sebor 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.=