From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2011A385C405; Mon, 23 Aug 2021 09:53:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2011A385C405 From: "d-ef at yandex dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102006] A false warning "Array subscript -N is outside array bounds warning" Date: Mon, 23 Aug 2021 09:53:30 +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: 11.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: d-ef at yandex dot ru X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Mon, 23 Aug 2021 09:53:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102006 --- Comment #8 from Dmitriano --- (In reply to Dmitriano from comment #7) > (In reply to Richard Biener from comment #6) > > It sounds like the usual upcasting of a link-only node which is strictly > > non-conforming and can also result in TBAA issues but it's wide-spread.= =20 > > Note I didn't look into the source at all. >=20 > Yes it is a warning about upcasting, I cast a list node (or list link) of > type Link to list element of type T. Theoretically Link should always be a > subobject of T in my code. Saying more exactly, Link should be a subobject of T when I cast it, but not always.=