From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 97CAE384F6CD; Sat, 26 Nov 2022 18:03:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 97CAE384F6CD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669485804; bh=NqqB3dtSkfJcK468XnRH0VmcG/ljSlqCsmMa5QN62EY=; h=From:To:Subject:Date:From; b=mZt1t1Ma9viB5tCtBLLAjo029CvTrjr7N+NjmG+OMSd5z/sQDHzdOVuSwuW6YHnSy NgehWXc9fCt8DiYTk3i/kL34nLOyQWi6OzON9p2XPtiJWW2XyvCzNGA809Hpg7bipv FhF4N4lIyGo0w19i7DCQoizqiu9rEj6LHMBAl++s= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107880] New: bool tautology missed optimisation Date: Sat, 26 Nov 2022 18:03:24 +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: 13.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=3D107880 Bug ID: 107880 Summary: bool tautology missed optimisation Product: gcc Version: 13.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: --- >From bug 91882 comment #1 (since the testcase in that was in bug 91882 comm= ent #0 is now fixed): bool impl(bool a, bool b) { return (!a || b); } // bad optimisation bool always_true(bool a, bool b) { return (impl(a,b) =3D=3D impl(b,a)) =3D=3D (a =3D=3D b); // ( (a -> b) =3D (b -> a) ) =3D (a =3D b) tautology }=