From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 28D4A3858C83; Tue, 26 Jul 2022 12:56:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 28D4A3858C83 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/104787] [12/13 Regression] False positive -Wreturn-type since r12-5638-ga3e75c1491cd2d50 Date: Tue, 26 Jul 2022 12:56:28 +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: 12.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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: 12.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: priority 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Jul 2022 12:56:28 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D104787 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P3 |P2 CC| |rguenth at gcc dot gnu.org --- Comment #5 from Richard Biener --- So the case is probably similar - without the early folding we go all the way, transforming struct FileAccessRef f; try { if (1) { return =3D 0; } } finally { FileAccessRef::~FileAccessRef (&f); } __builtin_trap (); to D.2402 =3D 0; // predicted unlikely by early return (on trees) predictor. finally_tmp.0 =3D 0; FileAccessRef::~FileAccessRef (&f); if (finally_tmp.0 =3D=3D 1) goto ; [INV] else goto ; [INV] since the return-type diagnostic is before any kind of optimization it probably diagnoses this by design. Otherwise it would be appropriate to move the diagnostic to the build_ssa_passes set of diagnostic passes which could share a common VN run to mark unreachable blocks. In the end I'm currently not working on the middle-end unreachable code diagnostic so we can as well revert the frontend change causing all this fallout ...=