From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 855F93858C50; Tue, 12 Sep 2023 15:02:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 855F93858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694530947; bh=BliXFakeYfgbG+VuUOyXX9fhmV2v4xH/HAo+Z9/BlN8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Agbm8DWwOjozjv2b+uGMV3JW2IXbL7TzhIEgy/JirFQ9OrDnXzN0erYaKn8lVwsI6 faw6rQB/buWFTPY0SAJ2XhyTSI1510Du0lNQ9Uc3L8wIJQSYh0mIdoxm+EyyPZwoBv y6TdpGOSLz+llAWuZBPT5NSA/WN7yCHz6Sj9zeqo= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107881] (a <= b) == (b >= a) should be optimized to (a == b) Date: Tue, 12 Sep 2023 15:02:26 +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: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: cvs-commit 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107881 --- Comment #17 from CVS Commits --- The trunk branch has been updated by Andrew Pinski : https://gcc.gnu.org/g:895e476f64c308dfdbf49693d0b1166c0b7733de commit r14-3881-g895e476f64c308dfdbf49693d0b1166c0b7733de Author: Andrew Pinski Date: Mon Sep 11 15:35:59 2023 -0700 MATCH: Simplify (a CMP1 b) ^ (a CMP2 b) This adds the missing optimizations here. Note we don't need to match where CMP1 and CMP2 are complements of each other as that is already handled elsewhere. I added a new executable testcase to make sure we optimize it correctly as I had originally messed up one of the entries for the resulting comparison to make sure they were 100% correct. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/107881 gcc/ChangeLog: * match.pd (`(a CMP1 b) ^ (a CMP2 b)`): New pattern. (`(a CMP1 b) =3D=3D (a CMP2 b)`): New pattern. gcc/testsuite/ChangeLog: * gcc.c-torture/execute/pr107881-1.c: New test. * gcc.dg/tree-ssa/cmpeq-4.c: New test. * gcc.dg/tree-ssa/cmpxor-1.c: New test.=