From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DF8333858C52; Mon, 12 Feb 2024 02:39:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF8333858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707705562; bh=9b8PRtnFwsP0jRgfLI8EkCdlQcRacbd2FPtAWKP3X7M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c43YAvsVPKEomsPgPBPtvqHUNENOT8cBU4VOtzdxC9+IFt8TUYVrDynEL3RZj55Lt xxXEd8mVvPUnTtGxiA9die1HggJtGX5IWCuRSLy9P66mUZWAo2xxNgPKKni8oxbKDx tmw7jsJK6cG3LEJ5XNKrFeofwn/fUwc1ZlIi238E= From: "xry111 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/10837] noreturn attribute causes no sibling calling optimization Date: Mon, 12 Feb 2024 02:39:17 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 3.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 3.4.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: see_also 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=3D10837 Xi Ruoyao changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://gcc.gnu.org/bugzill | |a/show_bug.cgi?id=3D83324 CC| |xry111 at gcc dot gnu.org --- Comment #16 from Xi Ruoyao --- (In reply to gooncreeper from comment #15) > May I suggest we just add something like __attribute__((trace)) for the > special abort case? Noreturn was added for code optimization after all, n= ot > for backtracing. It will break any attempts to debug an abort until the libc headers are upd= ated to use __attribute__((trace)). Note that in GCC noreturn has been added far before the WG14 _Noreturn paper (even this ticket predates the WG14 paper), so the rationale in the paper m= ay not apply. In practice most _Noreturn functions are abort, exit, ..., i.e. they are on= ly executed one time so optimizing against a cold path does not help much. I don't think it's a good idea to encourage people to construct some fancy co= de by a recursive _Noreturn function (why not just use a loop?!) And if you m= ust write such fancy code anyway IMO musttail attribute (PR83324) will be a bet= ter solution.=