From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 52F823858005; Sun, 25 Jul 2021 05:07:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 52F823858005 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/80588] GCC can't simplify static inline function with xor/xnor Date: Sun, 25 Jul 2021 05:07:31 +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: 7.0 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: cf_reconfirmed_on everconfirmed bug_status assigned_to 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: Sun, 25 Jul 2021 05:07:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D80588 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-07-25 Ever confirmed|0 |1 Status|UNCONFIRMED |ASSIGNED Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot = gnu.org --- Comment #4 from Andrew Pinski --- On the trunk the only one missing is test2b: _8 =3D a_4(D) !=3D 0; _9 =3D b_3(D) !=3D 0; _10 =3D _8 ^ _9; _1 =3D ~_10; _7 =3D _8 =3D=3D _9; _2 =3D _1 =3D=3D _7; _5 =3D (int) _2; If _7 is converted to _8 ^ _9 we would see _7 and _10 are the same _10 =3D _8 ^ _9; _1 =3D ~_10; _7 =3D _10; _2 =3D _1 ^ _7; And then you have: (~_10 ^ _10) Which is always 1 And done. So: (simplify (eq truth_value@0 truth_value@1) (bit_xor @0 @1)) (simplify (ne truth_value@0 truth_value@1) (bit_xor (bit_xor @0 @1)) { build_one_cst (type); })=