From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 035B5385840C; Mon, 7 Aug 2023 09:05:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 035B5385840C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1691399124; bh=QTet5fjyHWq9r+Tr7hdgOyO8Bg//jXPqwsC0yn/tQXE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=dFI2QjbveEEnIDZYlFOPkYmmU279mDUkwE9fvqpvGQMTQMFRJ9W8arA6i6mtK2P1+ wA8FPi1ek4AINwbvUFeCXSLUh/Z0iA0FunnMwY8TfEP5jZ76d+p/0uzQGqMJR8xrBn e3ngDTdzStT5SRoktttNtDik69hM113dPfiXdU98= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/110361] [13/14 Regression] Missed Dead Code Elimination when using __builtin_unreachable since r13-2020-g16b013c9d9b Date: Mon, 07 Aug 2023 09:05:21 +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: 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: 13.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on everconfirmed bug_status 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=3D110361 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-08-07 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #2 from Andrew Pinski --- Confirmed. What is interesting is we have: ``` [local count: 525923045]: g =3D &p; f.0_18 =3D f; if (f.0_18 =3D=3D 0) goto ; [50.00%] else goto ; [50.00%] [local count: 225485782]: g =3D &p; f.0_36 =3D f; if (f.0_36 =3D=3D 0) goto ; [50.00%] else goto ; [50.00%] ``` Those bb's are exactly the same. Their pred bbs are: ``` [local count: 751619280]: if (e.4_19 =3D=3D &a) goto ; [30.00%] else goto ; [70.00%] [local count: 526133498]: if (e.4_19 =3D=3D &d) goto ; [99.96%] else goto ; [0.04%] ``` Their succ branch (that matters) is: ``` [local count: 375914866]: c =3D &m; m =3D{v} {CLOBBER(eol)}; _22 =3D e.4_19 =3D=3D &d; _1 =3D e.4_19 =3D=3D &a; _23 =3D _1 | _22; if (_23 !=3D 0) goto ; [25.16%] else goto ; [74.84%] ``` So coming into bb13, we know that `(e.4_19 =3D=3D &d) | (e.4_19 =3D=3D &a)`= is true. Removing the branch to bb 10 which was the call to foo: [local count: 281323581]: foo ();=