From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1D4D73858D35; Mon, 28 Aug 2023 06:53:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1D4D73858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693205626; bh=pACx/QKz9kcC7xU2/F6bTjePC440HfuIJiEe/vHfTLM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=M5xkt2FluovUlM/aJWMLXmwpWCswGnxPzo+zojoKvBGqRWaVq3Awv0mDQLAaMRUii 2HskVtjA7qDKJZm9ee20qVLTl03552rXzwm1srbsJi7T/OF8oFoKV/AEAJ9tIDx9lr oWK5MFELWmaHD/VlqNTQZijAYPDJszQbLTeQRhXc= From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110891] [14 Regression] Dead Code Elimination Regression since r14-2674-gd0de3bf9175 Date: Mon, 28 Aug 2023 06:53:45 +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: normal X-Bugzilla-Who: rguenther at suse dot de 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: 14.0 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=3D110891 --- Comment #7 from rguenther at suse dot de --- On Sat, 26 Aug 2023, pinskia at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110891 >=20 > --- Comment #4 from Andrew Pinski --- > (In reply to Andrew Pinski from comment #3) > > One thing I noticed (I don't know if causes the missed optimization) is= that > > we have before PRE: > > ``` > > [local count: 1073531371]: > > if (a.0_1 !=3D 0) > > goto ; [50.00%] > > else > > goto ; [50.00%] > >=20 > > [local count: 536765686]: > > if (_28 =3D=3D &d) > > goto ; [30.00%] > > else > > goto ; [70.00%] > >=20 > > [local count: 536765685]: > > if (_28 =3D=3D &d) > > goto ; [30.00%] > > else > > goto ; [70.00%] > > ``` > > Which obvious should just be `if (_28 =3D=3D &d) goto bb9; else goto bb= 7;` and > > not check `a.0_1` at all. >=20 > I wonder if ifcombine could optimize that instead of requiring PRE. I thi= nk > that might even fix the issue too. Note it's the tail-merging code that optimizes this, not PRE (yeah, those passes should be ripped apart)=