From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C568B3857C4F; Thu, 9 May 2024 17:33:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C568B3857C4F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1715276019; bh=ZfSGsel8ts7wCPhxqKKeDaw6QFMe0A5UKIfWXXc8tt0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BSE4ZWWVnGRJQ0f54obnGPhuJ+r1Bm9QFqfHSVSOIafJjFWu9/gir4aZeUdN+NaxN zmamEe8fAwd8wtMdYSjZ5tSt2KQfbNKx7A+NueoUySP2yXB+/ILWuCHCKNG9wXfZC+ gb8Fv/lAr2o1MNX3auh9U4s8Kz2szJHQ3SLrm3cg= From: "sezeroz at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115005] [gcc-13] bogus -Warray-bounds warning Date: Thu, 09 May 2024 17:33:39 +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.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: sezeroz at gmail dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D115005 --- Comment #3 from Ozkan Sezer --- > There is a jump threading there handling n=3D=3D0 (aka numbits=3D=3D-1u) = and that is > causing the warning. The thing is, n=3D=3D0 is not guarding against numbits=3D=3D-1u: it is guar= ding against 0 members of fetch_16bit[] (and fetch_8bit[]) arrays. As far as I can see, that's where gcc13 is confused, no? > Now if I understand it numbits can't be more than 128 > (or even 16 in the 16bit case). Indeed: 15 is the upper limit in 16 bit case, and 7 in 8 bits case.=