From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8320A385DC15; Mon, 26 Jul 2021 00:28:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8320A385DC15 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/101617] a ? -1 : 1 -> (-(type)a) | 1 Date: Mon, 26 Jul 2021 00:28:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 12.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 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: Mon, 26 Jul 2021 00:28:38 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101617 --- Comment #7 from Andrew Pinski --- A few more canonicalization issues that need to be thought of: "a >>u (bitsize-1)" and "a >s (bitsize-1)" and "-(a Thinking about this some more, there is a canonicalization issue. We need= to > decide if we want to canonicalization to just a ? -1 : 1; or expand it ou= t. > a ? 1 : 0 makes sense to do (cast) a; So does "a ? 0 : 1". >=20 > Does the current a ? -1 : 0 make sense or just add that to ifcvt. PR101339 is related to that canonicalization really. There are others. Even things like: (a =3D=3D 0) + 2 Should that be: a =3D=3D 0 ? 3 : 2 On the gimple level and then do the correct thing on the RTL level?=