From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B6AE23858D20; Sat, 13 Jan 2024 17:01:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6AE23858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705165299; bh=VG9QJMjLdyFcicENMfAnPaSkFwxASgnVwb/drKzQPqA=; h=From:To:Subject:Date:From; b=Uk9pqvq2MC1rrP7+APABzPczJysxXmkqw+C/vKSUh/HJcd6qi2P4yxe/Zux8itj9b ddI49R+FTsVmesbSiqVrZ8nkwuecV28xZefSfrnXU5ySiM9vmuRTdioVOkT2A1W43m LztMoYnTeuoboFrFWW6SzA29l2oLlvtZkJMn+h1c= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113380] New: `(a CMP CST) | (a*a CMP CST1)` is not optimized as decent as with `||` Date: Sat, 13 Jan 2024 17:01:39 +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=3D113380 Bug ID: 113380 Summary: `(a CMP CST) | (a*a CMP CST1)` is not optimized as decent as with `||` 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: ``` int foo(int a) { return (a < 4) | (a * a > 7); } int bar(int a) { return (a < 4) | (a * a < 7); } int baz(int a) { return (a > -4) | (a * a > 7); } int qux(int a) { return (a > -4) | (a * a < 7); } ``` This is not as optimized as: ``` int foo(int a) { return (a < 4) || (a * a > 7); } int bar(int a) { return (a < 4) || (a * a < 7); } int baz(int a) { return (a > -4) || (a * a > 7); } int qux(int a) { return (a > -4) || (a * a < 7); } ```=