From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EE5B93853C30; Mon, 2 Aug 2021 12:31:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE5B93853C30 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/101642] [12 Regression] ice in decompose, at wide-int.h:984 Date: Mon, 02 Aug 2021 12:31:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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, 02 Aug 2021 12:31:11 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101642 --- Comment #14 from CVS Commits --- The master branch has been updated by Roger Sayle : https://gcc.gnu.org/g:f9fcf754825a1e01033336f84c18690aaa971a6f commit r12-2657-gf9fcf754825a1e01033336f84c18690aaa971a6f Author: Roger Sayle Date: Mon Aug 2 13:27:53 2021 +0100 Optimize x ? bswap(x) : 0 in tree-ssa-phiopt Many thanks again to Jakub Jelinek for a speedy fix for PR 101642. Interestingly, that test case "bswap16(x) ? : x" also reveals a missed optimization opportunity. The resulting "x ? bswap(x) : 0" can be further simplified to just bswap(x). Conveniently, tree-ssa-phiopt.c already recognizes/optimizes the related "x ? popcount(x) : 0", so this patch simply makes that transformation make general, additionally handling bswap, parity, ffs and clrsb. All of the required infrastructure is already present thanks to Jakub previously adding support for clz/ctz. To reflect this generalization, the name of the function is changed from cond_removal_in_popcount_clz_ctz_pattern to the hopefully equally descriptive cond_removal_in_builtin_zero_pattern. 2021-08-02 Roger Sayle gcc/ChangeLog * tree-ssa-phiopt.c (cond_removal_in_builtin_zero_pattern): Renamed from cond_removal_in_popcount_clz_ctz_pattern. Add support for BSWAP, FFS, PARITY and CLRSB builtins. (tree_ssa_phiop_worker): Update call to function above. gcc/testsuite/ChangeLog * gcc.dg/tree-ssa/phi-opt-25.c: New test case.=