From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B14A3385AC0A; Mon, 6 Sep 2021 20:46:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B14A3385AC0A From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/102216] False positive warray-bounds with -O2 Date: Mon, 06 Sep 2021 20:46:14 +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: 12.0 X-Bugzilla-Keywords: diagnostic, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia 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, 06 Sep 2021 20:46:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102216 --- Comment #2 from Andrew Pinski --- (In reply to Andrew Pinski from comment #1) > The problem is dead code: > language_names_p_9 =3D &MEM [(void *)_4 + 24B]; > MEM[(const char * *)_4 + 24B] =3D ""; > MEM[(const char * *)_4 + 32B] =3D ""; > MEM[(const char * *)_4 + 40B] =3D 0B; > _2 =3D _4 + 40; > D.50907._M_comp =3D compare_cstrings; > __comp =3D D.50907; > if (_2 !=3D language_names_p_9) > goto ; [53.47%] > else > goto ; [46.53%] >=20 > [local count: 574129759]: > _15 =3D _2 - language_names_p_9; > _16 =3D _15 /[ex] 8; >=20 > ... > _22 =3D _2 - language_names_p_9; I have a (hack) patch which removes the first if statement but still does n= ot fold _15 and _22.=