From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7045B3858435; Tue, 27 Sep 2022 15:24:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7045B3858435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664292247; bh=yA35+FX4zeHZ9Fixt3gtfVjXQwMJQ90YH5m7RVqJVn8=; h=From:To:Subject:Date:From; b=AX1IHNxjQw7AgL3cgO1bPPQqybIM8myZPDpvLl3H/S0tKDCNTUhklwnhWglAHeA9V Yu+GaX5MZfiv8deOHhq3UbeQwKTDcarOAjdxVw9/1ZoHFjBdWmfsxCVejcoleumcNy VbIBvAOZ+wN5ki/pTozixYM37Qeg3juUVMRfteCo= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107053] New: ones bits is not tracked and popcount is not tracked Date: Tue, 27 Sep 2022 15:24:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org 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: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D107053 Bug ID: 107053 Summary: ones bits is not tracked and popcount is not tracked Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: pinskia at gcc dot gnu.org Target Milestone: --- Take: ``` void link_failure(); void f(int a) { a |=3D 0x300; int b =3D __builtin_popcount(a); if (b < 3) link_failure(); } ``` The if statement should be optimized away. The reason is after the |, at least 3 bits are set in a.=