From patchwork Wed Jan 31 02:17:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 1893190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=FtYnUWeY; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TPm3M0L5wz23g7 for ; Wed, 31 Jan 2024 13:20:31 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0311E3858281 for ; Wed, 31 Jan 2024 02:20:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id B6B603858437 for ; Wed, 31 Jan 2024 02:18:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6B603858437 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.intel.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=linux.intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B6B603858437 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706667521; cv=none; b=Z1VBJre+N5yuflGS1BhM0PSTXKz6x79mZjKMPzZqifb5ki92icFpENkUmRMW9OVAGh1AuZ9+s7DC9uvRKn7KjgNVI2MNz8aByu9+nk+TaDcOmFyfW5qtfn3nwF8t6XH8CyuSpWxIZpibubXjpiDaU+L1MQYLRn50bQiMiKFDZlQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706667521; c=relaxed/simple; bh=BRCMdtb27kmQ6UAxxYjJdjjFfMFamWSAsRsi+JtYznY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QPDgoChSVtrr2YjFd+0lbbNSXI6v41NbLlK29pD16mqn7w0NnF1g9Qc55EcPLqw9Vc982LV8ZVYUgzN/NNoWJG6BwdC3cugtpm45wI2BuNW8ieLeGp4+sWVjA3UCmuP5nGWIwFcOEbjklsW5wwBIqMLADSdrOfcWLy96zr+/8Ho= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mgamail.intel.com ([198.175.65.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rV0BR-0002Vy-Ng for gcc-patches@gnu.org; Tue, 30 Jan 2024 21:18:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706667518; x=1738203518; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BRCMdtb27kmQ6UAxxYjJdjjFfMFamWSAsRsi+JtYznY=; b=FtYnUWeYGMxQ6tLMqfnCWNR9XlW7Yo4jUqT8qWFZZsRQdKqxsaZ0FCDb 1UVP8rDwA2o/mNGqxGSn3AHDsvJIwaZkNppgkjSY9PLPkAwXCfS8mRUjD 4tMrs1K9P0lLCxgbKn1rA7TInoV72GzhM/PFEA8FiKVn1ObmDeAXvP5Z6 x+D7scOWAfr7NkuHBUR20xSP63GGIqz0mlqGZGeuDVmJ+Jxa+JD+HMe7p G4G43/8jZZsS1djgNpiz+dRXKPtG9zBjJ9AsWdfEGn3wdiUGWsidh0hM0 zjgg83gL33yDcfNno6k+6p7Go01tve/31HviJJnWJOSNaLWnf86yVaWx3 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="10561936" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="10561936" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 18:18:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="737946822" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="737946822" Received: from tassilo.jf.intel.com ([10.54.38.190]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 18:18:15 -0800 From: Andi Kleen To: gcc-patches@gnu.org Cc: Andi Kleen Subject: [PATCH v3 5/5] Add documentation for musttail attribute Date: Tue, 30 Jan 2024 18:17:18 -0800 Message-ID: <20240131021808.151575-6-ak@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240131021808.151575-1-ak@linux.intel.com> References: <20240131021808.151575-1-ak@linux.intel.com> MIME-Version: 1.0 Received-SPF: none client-ip=198.175.65.13; envelope-from=ak@linux.intel.com; helo=mgamail.intel.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.292, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org --- gcc/doc/extend.texi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 0bc586d120e7..1d413b0ef6d1 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -9867,6 +9867,22 @@ foo (int x, int y) @code{y} is not actually incremented and the compiler can but does not have to optimize it to just @code{return 42 + 42;}. +@cindex @code{musttail} statement attribute +@item musttail + +The @code{gnu::musttail} or @code{clang::musttail} attribute +can be applied to a return statement that returns the value +of a call to indicate that the call must be a tail call +that does not allocate extra stack space. + +@smallexample +[[gnu::musttail]] return foo(); +@end smallexample + +If the compiler cannot generate a tail call it will generate +an error. Tail calls generally require enabling optimization. +On some targets they may not be supported. + @end table @node Attribute Syntax