From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3C6AA38582A1; Mon, 7 Aug 2023 16:52:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C6AA38582A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691427137; bh=4iU6ES7lr2eR19zPGP0J5SVvILyVuKdoI3qQg47zPys=; h=From:To:Subject:Date:From; b=Hv7HhKyQ0EGldtbBpHhF6sNBFCzVJMDJYffK7qEZejZM1Bk9py/AgtHvrARwZEQan jRzvHKTJ3kQyiOuTmHyiGJOaJLnbU/+zwQrU7nJdPbkgbLuGarNsYCTjkrC66z5+1H p/pa3qrqjmv/8JL5T/VvKYwZllp9H4v9wJlDudfE= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110937] New: (bool0 ? bool1^1 : bool1) is not optimized to bool0 ^ bool1 Date: Mon, 07 Aug 2023 16:52:17 +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: 14.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=3D110937 Bug ID: 110937 Summary: (bool0 ? bool1^1 : bool1) is not optimized to bool0 ^ bool1 Product: gcc Version: 14.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: ``` _Bool f2(_Bool a, _Bool b) { if (a) return !b; return b; } ``` This should be optimized to just: ``` _Bool f2_(_Bool a, _Bool b) { return a ^ b; } ```=