From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 20C8B3858406; Wed, 12 Jan 2022 19:34:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20C8B3858406 From: "amacleod at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/98026] optimization dependant on condition order Date: Wed, 12 Jan 2022 19:34: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: 11.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: amacleod at redhat dot com 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: cc 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: Wed, 12 Jan 2022 19:34:35 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98026 Andrew Macleod changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amacleod at redhat dot com --- Comment #3 from Andrew Macleod --- Although we are now adding relations for these expressions, onc extension we have not gotten to apply ranges of relations. ie: : _1 =3D j_5(D) > i_6(D); _2 =3D i_6(D) > 100; _3 =3D _1 | _2; if (_3 !=3D 0) goto ; [INV] else goto ; [INV] 2->3 (T) _3 : bool [1, 1] 2->4 (F) _1 : bool [0, 0] 2->4 (F) _2 : bool [0, 0] 2->4 (F) _3 : bool [0, 0] 2->4 (F) i_6(D) : int [-INF, 100] Relational : (j_5(D) <=3D i_6(D)) : if (j_5(D) > 100) goto ; [INV] else goto ; [INV] 4->5 (T) j_5(D) : int [101, +INF] 4->6 (F) j_5(D) : int [-INF, 100] We know that j_5 is <=3D i_6 on the edge 2->4, but we do not apply any known range of i_6 to j_5. We do transitive between symbolics, ie (j < x && x < y means j < y) We do not yet do that with a range as this requires. ie: j_5 <=3D i_6, i_6 <=3D 100 means j <=3D 100 This will be an enhancement for the next release.=