From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2A66B385781E; Wed, 13 Mar 2024 19:06:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A66B385781E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710356788; bh=WHUq++MgYRKYs9bXJ7khwGcFPbZ9BMt8rtFYxlbO4KY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=v65/fXh7tFCI8i8WKkrHL+T7dQLQJhux+ToyM9Gv0Z8CzPNG9210qqKGcRziiAsdf v7KSj+2Vv8dU9QGtqf66AF7/tG6BxSmUxqRvVuT6wR03swMU9LMEsrxkQCLp/XCF4I 0sqqVQjOXlF9CoSi4XN9/GQsTCFV+VbHVpzUTUrs= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114326] Missed optimization for A || B when !B implies A. Date: Wed, 13 Mar 2024 19:06:27 +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: 14.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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: everconfirmed bug_status cf_reconfirmed_on 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=3D114326 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW Last reconfirmed| |2024-03-13 --- Comment #1 from Andrew Pinski --- _1 =3D d1_5(D) ^ d2_6(D); _2 =3D _1 & 43981; _10 =3D d1_5(D) !=3D d2_6(D); _11 =3D _2 =3D=3D 0; _12 =3D _10 | _11; (d1 !=3D d2) | ((d1 ^ d2) & CST) =3D=3D 0) Confirmed. Obvious if the first part is false then d1 ^ d2 will be 0. This will work though maybe there is another place where this can be handled ... (simplify (bit_ior (ne@n4 @0 @1) (cmp (bit_and (bit_xor @0 @1) @2) @3)) (bit_ior @n4=20 (cmp { build_zero_cst (TREE_TYPE (@0)); } @3)) )=