From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B0CB0385740D; Mon, 6 Sep 2021 11:25:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B0CB0385740D From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94675] [9/10/11/12 regression] -Warray-bounds false positive with -O2 since r9-1948 Date: Mon, 06 Sep 2021 11:25:44 +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: 9.3.0 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: 9.5 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, 06 Sep 2021 11:25:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94675 --- Comment #20 from Andrew Pinski --- So on the trunk we get: c_len.0_1 =3D c_len; _2 =3D (long unsigned int) c_len.0_1; _6 =3D &c + _2; MEM [(struct pstream_t *)&ps] =3D &c; MEM [(struct pstream_t *)&ps + 8B] =3D _6; _17 =3D (signed long) c_len.0_1; _11 =3D _17; _12 =3D (long unsigned int) _11; if (_12 > 6) goto ; [50.00%] else goto ; [50.00%] [local count: 483183820]: ps.D.4009.s =3D &MEM [(void *)&c + 7B]; [local count: 590558005]: Which is correct, I think the original testcase and the testcase in comment= #1 and comment #11 are bogus and incorrect. There is always an out of bounds.=