From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0318C38708D6; Mon, 27 Apr 2020 15:22:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0318C38708D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1588000966; bh=tXq+BsGF45aXnq0teSEgKFv9/uSJ4R6ZLaOj4FMO4qs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OLnxL1pjptoCbxb4l2d7vuR6j3daN7oioOG8javpAyQYyLRTvtXiajb1BA1zGrfMf BxTSdq9t65gR0tEw/TLdXdMO4JqIWbsTI0Uiqh0+X6yNtzRbj8BNWwlBV6AK70RkO5 w4/UlTrQNWoqxAuZqrIJ9j1xI+H6O3nPI3uIq20Q= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/94802] Failure to recognize identities with __builtin_clz Date: Mon, 27 Apr 2020 15:22:45 +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: 10.0 X-Bugzilla-Keywords: easyhack, missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW 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: bug_status keywords cf_reconfirmed_on cc everconfirmed 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, 27 Apr 2020 15:22:46 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94802 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |easyhack, | |missed-optimization Last reconfirmed| |2020-04-27 CC| |jakub at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Jakub Jelinek --- For the first one, guess __builtin_clz (x) =3D=3D 0 can be transformed into= (int) x < 0 and similarly __builtin_clz (x) !=3D 0 to (int) x >=3D 0. Not sure if we should check CLZ_DEFINED_VALUE_AT_ZERO if it isn't 0 (or precision-1) for these transformations, while the documentation says that t= he builtin is undefined at zero, e.g. if CLZ_DEFINED_VALUE_AT_ZERO returns 2 t= hen even at GIMPLE the =3D=3D 0 guard for it could have been optimized away alr= eady.=