From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B81D43858005; Tue, 26 Oct 2021 14:24:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B81D43858005 From: "siddhesh at gotplt dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/101397] [11 Regression] spurious warning writing to the result of stpcpy minus 1 Date: Tue, 26 Oct 2021 14:24:12 +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: siddhesh at gotplt dot 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.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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, 26 Oct 2021 14:24:12 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101397 Siddhesh Poyarekar changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |siddhesh at gotplt dot org --- Comment #7 from Siddhesh Poyarekar --- (In reply to CVS Commits from comment #4) > The master branch has been updated by Martin Sebor : >=20 > https://gcc.gnu.org/g:8bf5b49ebd2176b8c535147377381dd07fbdd643 >=20 > commit r12-2422-g8bf5b49ebd2176b8c535147377381dd07fbdd643 > Author: Martin Sebor > Date: Tue Jul 20 13:48:20 2021 -0600 >=20 > Correct stpcpy offset computation for -Warray-bounds et al. [PR101397= ]. This causes a crash with the following program due to an infinite recursion: typedef __SIZE_TYPE__ size_t; void __attribute__ ((noinline)) foo (size_t x) { struct T { char buf[64]; char buf2[64]; } t; char *p =3D &t.buf[8]; char *r =3D t.buf2; size_t i; for (i =3D 0; i < x; i++) { r =3D __builtin_mempcpy (r, p, i); p =3D r + 1; } } $ cc1.r12-2422 -quiet -o - repro.c=20 .file "repro.c" .text Segmentation fault (core dumped)=