From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7DF553959CAD; Thu, 8 Dec 2022 10:58:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7DF553959CAD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1670497138; bh=f+RW5BnZbzWB6ev71b4O8dAl/xvUq53h8iFcRVDLFcs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Y/SiwsJgU7vynd7uN0ukYsk4SjUnKsLz5KtSWI/qtZ0+SBt7crlefiFKCx2XgxAqa iT2DqvYvvRVNsnFSiWuQuWWpUSu7BRvncbS4z0XWRxmReGo6VuyalVUCASHkO3O5P0 MrUzXlQE0cSX0lYt0VfVDoeU9LWo9N537NxiMbNQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107699] [12/13 Regression] False positive -Warray-bounds, non-existent offset reported by GCC Date: Thu, 08 Dec 2022 10:58:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107699 --- Comment #9 from CVS Commits --- The master branch has been updated by Richard Biener : https://gcc.gnu.org/g:892e8c520be37d0a0f14e2ae375103c5303ed549 commit r13-4555-g892e8c520be37d0a0f14e2ae375103c5303ed549 Author: Richard Biener Date: Thu Dec 8 09:07:36 2022 +0100 tree-optimization/107699 - missed &data._M_elems + _1 !=3D &data._M_ele= ms folding The following addresses a missed folding noticed in PR107699 that can be fixed amending the existing &x + a !=3D &x + b pattern to also handle the case of only one side having a pointer plus. I'm moving the patterns next to related simpifications showing there'd be an existing pattern matching this if it were not gated with an explicit single_use constraint. Note the new pattern also handles &x.a + a !=3D &x.b, but this hints at some unification / generalization opportunities here. PR tree-optimization/107699 * match.pd (&a !=3D/=3D=3D &a.b + c -> (&a - &a.b) !=3D/=3D=3D = c): New pattern variant. * gcc.dg/tree-ssa/pr107699.c: New testcase.=