From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A8AF3858C54; Fri, 3 Mar 2023 00:10:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A8AF3858C54 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677802238; bh=dsXSQ91XJL3q/xkJ13Dxa2939X5FFR2WRw7Ztc0Rmto=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MYQKqXwJEZd66mRXVy3Pz+B+pXT6Ay6SxSIa3PAuuAb4EgBK0Zkfiz8hRwPJwh/Kh L9uLhyiVSWJ31MZfQuMoxMC53QkELMhs8EWd1Q7bTyWQC20GoWwzriRXc7VWvyAk1B StP8K0rOZU5LMuym/KtCSlCWmxOXp6xhHtfm1PV0= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108997] GCC prediction on bool comparisons seems wrong Date: Fri, 03 Mar 2023 00:10:38 +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: 13.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal 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: 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=3D108997 --- Comment #4 from Andrew Pinski --- (In reply to Nikita Kniazev from comment #3) > For cond =3D=3D 789 > if (cond_2(D) =3D=3D 789) > goto ; [20.24%] > else > goto ; [79.76%] >=20 > For cond !=3D 789 > if (cond_2(D) !=3D 789) > goto ; [48.88%] > else > goto ; [51.12%] an intergal type equaling a specific # is handled this way on purpose. Bool should be handled differently because it only has two values, 0/1. Anyways !=3D is not handled specially except for the zero value case ...=