From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 52BAE3858D32; Sat, 16 Sep 2023 23:16:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52BAE3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1694906192; bh=FScsJcq0WQGgHiE1+QhKB48b5aWkZNCCjm/Rz/6KYbM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=fcEsGzw0Eptmm/YnUTUP4io7I0IZ9IuwLxIHqNGXfIK00YwHwB0rDkqnXFaW1SUWN XFUTqIy18+eObDVHbIu/hso1qBSTxvi9ph9fZw46xYrDZMtE5LDWU9nS2/XIFApTqx ELprKjEMFGc8BKENYDZcCQb0MRev1Ggudn1fMn7Y= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108370] gcc doesn't merge bitwise-AND if an explicit comparison against 0 is given Date: Sat, 16 Sep 2023 23:16:32 +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.2.1 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: pinskia at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108370 --- Comment #5 from Andrew Pinski --- _10 =3D _9 >> 1; _11 =3D (bool) _10; if (_11 !=3D 0) Should just be optimized to: _t =3D _9 & 1 if (_t !=3D 0) Let me add that to match.=