From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 583FA386F02B; Tue, 21 Apr 2020 07:58:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 583FA386F02B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587455934; bh=ULsTuC/TlI7WZ6EzKyEKl7cTbQfRdq/HF2LGPjayFM4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pYrTLquC1rBUmagSF+B7BNhre/CY+mIXR0R6OTRJOccsVBSP98srMFaHR1H+ux+aV 2L/5zK7j4MGPL1a66HSrP1avfR1LahbPKHI89L4q6W3VSDwuar9wmbnWOOuRwcO1x6 kD/nEraVMOownapwIyIgdR3oEGkEoVcbqo79wR0A= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94675] [9/10 regression] -Warray-bounds false positive with -O2 Date: Tue, 21 Apr 2020 07:58:54 +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: 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: 9.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_known_to_fail short_desc cf_known_to_work 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: Tue, 21 Apr 2020 07:58:54 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94675 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Known to fail| |10.0, 9.3.0 Summary|[9 regression] |[9/10 regression] |-Warray-bounds false |-Warray-bounds false |positive with -O2 |positive with -O2 Known to work| |8.4.0 --- Comment #4 from Richard Biener --- In the original testcase I clearly see some missed optimizations, notably the failure to "thread" if (_12 > 6) goto ; [50.00%] else goto ; [50.00%] [local count: 536870913]: [local count: 1073741824]: # iftmp.2_13 =3D PHI <0(3), 1(2)> _14 =3D (_Bool) iftmp.2_13; if (_14 !=3D 0) goto ; [90.00%] else goto ; [10.00%] and as you say simplification of a pointer comparison _6 =3D &c + _2; _11 =3D _6 - &c; _12 =3D (long unsigned int) _11; if (_12 > 6) we're doing the simplification only late because forwprop depends on FRE and FRE doesn't apply match.pd rules unrestricted like forwprop does. Not doing any DCE before VRP probably doesn't help either (DCE would have removed the offending statement).=