From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8FB5F3858412; Thu, 26 Oct 2023 20:22:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8FB5F3858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698351738; bh=PfdpAhJV8pAlegLeSzK2fo4ekyJ+tyFZdOFpjnlr+io=; h=From:To:Subject:Date:In-Reply-To:References:From; b=yRQB1JopSqipoZpff4I89ITkwLzozP1qEE5ef2mv8n0aMD82L047OFS6SHhic09Tw QJGWPo+7yA71VWe+by3z9lMlvbYPeo6xwOLaTEmrpdDjWXfoNqfMiJhn2DMehoN+d6 eWhysHfB3xaj4QLBJW6v/3x7qB1xzXtT7u4MGd44= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/112096] `(a || b) ? a : b` should be simplified to a Date: Thu, 26 Oct 2023 20:22:18 +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: 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: 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=3D112096 --- Comment #3 from Andrew Pinski --- (In reply to Andrew Pinski from comment #2) > ``` > int t01(int x, int y) > { > bool t =3D x =3D=3D 5 && y =3D=3D 5; > if (t) return 5; return y; > } // y > ``` > Is able to be detected in phiopt2. Just not the =3D=3D 0/!=3D0 case. r0-125639-gc9ef86a1717dd6 added that code. https://inbox.sourceware.org/gcc-patches/000001cebdbf$a3155310$e93ff930$@ar= m.com/ I really have not read this code in over 10 years and I forgot I even revie= wed it slightly. Anyways I am thinking about ways of improving this even further ... And maybe even rewriting part of it since it has got way too complex.=