From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DD57A3858C53; Sat, 26 Aug 2023 05:47:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DD57A3858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1693028848; bh=2xHi2wfXzqnmaEG/KOBp+MJoCO27gwbaP0aLbDU3Wxo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=bwZ6bC9sIkpJMGJzv5D/I78LnLZxTd6v298JYlczK6TVwg0xRJlEX4mzpmaoN0jt8 PQnXbtKwPVVdOavBRNUn5QSZcnt+tEMW3rel1KdzBo/aFp0GgmnHb0kA2WQt3/RJUp TcgKcXw0b44wbrBokIeQ7vyub4GLQtLwqY7Wyw98= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/38264] tree_forwarder_block_p says no to first basic block Date: Sat, 26 Aug 2023 05:47:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 4.4.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW 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=3D38264 --- Comment #6 from Andrew Pinski --- I actually just ran into a problem caused by having this check here. I was modifying tree-ssa-ifcombine to optimize the case where we have the s= ame condition on both bb from a bb like: ``` int g(); int h(); int j, l; int f(int a, int *b) { if (a =3D=3D 0) { if (b =3D=3D &j) goto L9; else goto L7; } else { if (b =3D=3D &j) goto L9; else goto L7; } L7: return g(); L9: return h(); } ``` I go and try to remove one of the bb (which have the same condition) and th= at should have updated dominators in a reasonable way because the removal shou= ld have done a forwarder from bb 2 to bb3. But instead of doing the forwarding= of the bb, we end up with still bb3 and the dominator needs to be updated in non-trival ways.=