From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9E3A13AA8022; Fri, 13 Mar 2020 03:09:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E3A13AA8022 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1584068978; bh=kOnp+8y84T8305JIkOTnUuYC2RUT/LtZtEbjKM9WmnE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=G0/I6CZZm6p7suVWdSwEotyVNpS9GoWb8+fuJltMwx07Q/0Dj5pmT2hPFQT/hmqul kcCV6DcxSNJhElmtUFbSbMn8LdRv/v4TjuRmHMoO9+FE9+9ll+6tu0o4xiHShqMX3L ikKGhpyQRmFu2L2StKnzg1glkTv8YCa8EBqA9J/g= From: "felix.yang at huawei dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/94026] combine missed opportunity to simplify comparisons with zero Date: Fri, 13 Mar 2020 03:09:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: felix.yang at huawei dot com X-Bugzilla-Status: UNCONFIRMED 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: 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: Fri, 13 Mar 2020 03:09:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94026 --- Comment #2 from Fei Yang --- The test case is reduced from spec2017 benchmark. int FastBoard::count_pliberties(const int i) { return count_neighbours(EMPTY, i); } // count neighbours of color c at vertex v int FastBoard::count_neighbours(const int c, const int v) { assert(c =3D=3D WHITE || c =3D=3D BLACK || c =3D=3D EMPTY); return (m_neighbours[v] >> (NBR_SHIFT * c)) & 7; } bool FastBoard::self_atari(int color, int vertex) { assert(get_square(vertex) =3D=3D FastBoard::EMPTY); // 1) count new liberties, if we add 2 or more we're safe if (count_pliberties(vertex) >=3D 2) { return false; } ......=