From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CB44C3858C20; Mon, 6 Mar 2023 08:32:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB44C3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678091544; bh=m2AAwmgREMPCt4I6GsUPsjYEDNN9Tt17jsOm2hMKdWU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Tyoi0eDKpX5DdcI+cwpZl1cnbhqaG8q3xQ3kvM+VbEhkaJ9BUANQIZwdF/EPEcD9c oykIKbzJYnakhc3bpwg8pmm0guoP6XNRHq0SmpK+cnIs0dX26Lg92MuruU9S1OmfLY pNR5+J2CDsq6CqiKdN2xSSw2RUUPe3fDByaSjfCo= 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: Mon, 06 Mar 2023 08:32:23 +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 #16 from Jakub Jelinek --- Created attachment 54590 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54590&action=3Dedit gcc13-pr109011-2.patch Here is what I have right now, totally untested and will need further work so that the two pattern recognizers work together nicely (I think the one modified by the earlier patch will for ctz/ffs need to trigger first and al= low ctz/ffs and be done even if for these they don't have direct optab but have ctz (for ffs), clz or popcount. And then let the new one rewrite it.=