From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8C7043857438; Wed, 12 Jul 2023 22:05:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8C7043857438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689199504; bh=GTpuJnUwLq2X8xZ1IevdAjx1QoZDO7u4F5QtKLJMFn4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CJf1emUEBJXHqR4uF9m+9taiXgt0dMCGdW/5AwoUfYfQCsiAKF8wPHuRNxnIbTRK0 K0GW1d7YOhg+a3dSSrUYtRY2LpgTi31F/rhTLLaUmc3S60ERjV8DadErdEKqIzWTdm qlVcfyYUntLJjJtq9WlrmqMQg2KLWfBLq0yxIItQ= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/99918] [11/12/13/14 Regression] suboptimal code for bool bitfield tests Date: Wed, 12 Jul 2023 22:05:04 +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: 11.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: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D99918 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pinskia at gcc dot gnu.org --- Comment #11 from Andrew Pinski --- (In reply to Martin Sebor from comment #2) > Bisection points to r225825 as the revision where GCC started to fail to > fold the code in g(). the fold-const didn't check `types_match (type, TREE_TYPE (@0))` but rather just did the equivalent to: (simplify (ne @0 integer_zerop@1) (if (TREE_CODE (TREE_TYPE (@0)) =3D=3D BOOLEAN_TYPE) (non_lvalue (convert @0)))) While match now does not do the convert and checks the types_match check instead.=