From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 66EA33857C71; Thu, 9 Mar 2023 10:18:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66EA33857C71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678357116; bh=T7TBcjEK+HgXGx7kCcNZOado1p8dfou3u5k3KsLa0lQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=tahsQXs3b+ExPWp5HyMGO8UD0beaNbFk+tW0eHgl6tcxJy7Jo3cenWQ+sd2p/X5yl bPz+ItUOIA/t98MaLdGMWsENOSvUeyZO3WK6kZmnqPv1RDM+2kiseDWUqin4XLwV1r BFnsAEIKlYe8xMteY/jh0m7zdmu49WCpzcqOmiGk= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109071] -Warray-bounds warning when array index checked via inline Date: Thu, 09 Mar 2023 10:18:35 +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: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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: bug_status everconfirmed cf_reconfirmed_on 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=3D109071 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2023-03-09 --- Comment #2 from Richard Biener --- Yep, so we produce [local count: 1073741824]: if (index_3(D) > 3) goto ; [33.00%] else goto ; [67.00%] [local count: 354334800]: warn (); *ptr_5(D) =3D 0; _17 =3D MEM [(int *)sg_2(D)].vals[index_3(D)]; warn (); [local count: 1073741824]: # _18 =3D PHI <_14(3), _17(4)> *ptr_5(D) =3D _18; return; (and BB 3 with a BB4 duplicate w/o warn () calls). If warn () were noreturn this wouldn't happen. And yes, we do have (plenty?) duplicates.=