From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 576E83858C36; Sat, 4 Mar 2023 14:01:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 576E83858C36 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677938481; bh=nFk+ZFWu8OjKEdtDyt3hNgqVzVOnTh+1aai7cE1/Ls0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=J1jIR82W4R93osg3h+98z09Y0vIBqvPf55v0CzuIqTqeX77dxoM44cuodzlhYPVm4 s2pPMzlJl2TBRltBoCL+6NWya70KRUPew2DT+ofhXwgH9uWTQoqI6aExe7OoMA23MJ FyQCICrfQD+N1RLacvQA0Ts6620dagIY/JjZ0pHs= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/109011] missed optimization in presence of __builtin_ctz Date: Sat, 04 Mar 2023 14:01:21 +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: 12.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created 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=3D109011 --- Comment #9 from Jakub Jelinek --- Created attachment 54584 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54584&action=3Dedit gcc13-pr109011.patch Untested patch to just extend the popcount handling to clz, ctz and ffs, th= ough for now only if they have corresponding optabs implemented. This improves = the __builtin_clzll testcase above, but doesn't help with ctz or ffs. Those will need to be added incrementally.=