From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2EDFA3858C60; Tue, 25 Apr 2023 17:04:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EDFA3858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682442248; bh=C97KzK3kVDveH627wvzj9cj9hBkv1brWo/MhCiXfdJ8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NGzE+48a2h02eShhSs7XFuvLPmOHAC1xKirSZ3aTmAkr/f4osGi4YJyN+9CVfD6wR NFcM8mYOA1by5gJZ3jIIGo45QDlOlgB/V1Pp0O7L2s2sPXIn0Rf4KN+KAvuToBdKFT QAH4ByPPaNuK+Ge7la/wyowZdi/kXOzQzDP/jUr4= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105523] Wrong warning array subscript [0] is outside array bounds Date: Tue, 25 Apr 2023 17:04:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: saaadhu 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105523 --- Comment #28 from Andrew Pinski --- (In reply to Wilhelm M from comment #26) > As you can see in my opening bug report, there is no nullptr reference nor > dereferencing a pointer with value 0. Yes but as I mentioned by the time the warning happens, the IR has lost information if the constant came from a null pointer or from some other constant that the user used. So a heuristic needs to be used and the idea w= as it would be the lower bytes by default and that the lower bytes would be defined by a "page size" and that is how the naming of the option happened.=