From patchwork Mon Mar 6 18:45:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 65046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2011456wrd; Mon, 6 Mar 2023 10:46:29 -0800 (PST) X-Google-Smtp-Source: AK7set8GhXTcCV8okXdFlDfuy/IE7ZcupEFzXyhhaGa36DXn8OXxds0qrlZu91+5GCu4YklaeYz0 X-Received: by 2002:a17:906:b08c:b0:8af:3b78:315d with SMTP id x12-20020a170906b08c00b008af3b78315dmr11213037ejy.23.1678128389542; Mon, 06 Mar 2023 10:46:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678128389; cv=none; d=google.com; s=arc-20160816; b=IfHYau3eHtrxz47yu8z7yARVVMy1aW7dkT7DaoUd/DGVaJ2kAPTvWevVVaRtfgj3pY BGuT5n2Vz1USEAWrFTrk4TaOrCeDqM3j4/LkSvfXAKzlYcZ3XMu/VE6Pils1UYKrgJpX iia5zpVOCvOsJUCNhtCz1BamQksHGXd+a0x7mPu3DLQe9IAlN+8m0hvC4W9zdfZzi+bR dgkvhz+K6eJRcLlok5VSdiqDCZKd3MUoTwS4vrfSsqRBu8v4k5THH+OtbvFhQImBM0WX XbQMfWPuW0n8g6HUktJjgOYMBqG1hez1M0lNacwwjfKImRfPgdDhFca6PYhn5VaXRIjV SOaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :content-transfer-encoding:mime-version:subject:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=tilu87pUXTJ8RVGLip2GQbJBesZr20PSgAm1R0jpi7k=; b=Jmwy/akFcW3bffAHFsypDvox3RyDBtGIymjRCVL1213uBJwh0LGOU4oesddKssR2as B+L24FFSmYdw1BxQbzmy3Pq7dywqs8YSDLgjqVOb4X+BR/tNsoeji+DR3BSkMWiPT+GD 1kUs2eo3GF/EzQHRcp9aG36prhFcZAiXUt4yqPmiAYV5eIUOU0Pjc8lc17LVzIGG2tLZ 5rQ/W5LZpRlDlzAkpLNoHqeX6bJbNf4slqwCb0LkAAr+dDSQdOFXTBRZSDSPDAVoX3v4 4sG+GHOVeMZCxXaZ2yurW0nn1FN1DrjGG96FXRpWCLHjnq+MSuRXH9eSgSfcv87/AXzv 0PQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pcJOzfk+; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id o2-20020aa7c502000000b004af625a0f8esi677383edq.395.2023.03.06.10.46.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 10:46:29 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=pcJOzfk+; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5AF3F3858035 for ; Mon, 6 Mar 2023 18:46:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AF3F3858035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678128388; bh=tilu87pUXTJ8RVGLip2GQbJBesZr20PSgAm1R0jpi7k=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=pcJOzfk+JHzG7cTnlDbI+9uBoAx/WGrv8b2c91g8hTQox9RwIhV8Bdmr+4vz0yTsR PJG1/uxT0mItJw45IE+wbi3moDcOY7ce22tmZ4UKwCnHUNF37UCSpq+IM12hhB7eEz qAgdAwPwq0bX2ocRFuggGKYU+1bfZNDu/MOQH/dk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 65AF43858D39 for ; Mon, 6 Mar 2023 18:45:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 65AF43858D39 To: Subject: [PATCH 1/3] testsuite: Add tail_call effective target MIME-Version: 1.0 Message-ID: <20230306184542.0517B20405@pchp3.se.axis.com> Date: Mon, 6 Mar 2023 19:45:42 +0100 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759645153942800669?= X-GMAIL-MSGID: =?utf-8?q?1759645153942800669?= Ok to commit? -- >8 -- The RTL "expand" dump is the first RTL dump, and it also appears to be the earliest trace of the target having implemented sibcalls. Including the "," in the pattern searched for, to try and avoid possible false matches, but there doesn't appear to be any identifiers or target names nearby so this is just belts and suspenders. Using "tail_call" as a shorter and more commonly used term than a derivative of "sibling calls", and expecting only gcc folks to have heard of "sibcalls". * lib/target-supports.exp (check_effective_target_tail_call): New. --- gcc/testsuite/lib/target-supports.exp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 0ca7a9680bb4..958537b3b7c0 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -11684,6 +11684,15 @@ proc check_effective_target_frame_pointer_for_non_leaf { } { return 0 } +# Return 1 if the target can perform tail-call optimizations of the +# most trivial type. +proc check_effective_target_tail_call { } { + return [check_no_messages_and_pattern tail_call ",SIBCALL" rtl-expand { + __attribute__((__noipa__)) void foo (void) { } + __attribute__((__noipa__)) void bar (void) { foo(); } + } {-O2 -fdump-rtl-expand-all}] ;# The "SIBCALL" note requires a detailed dump. +} + # Return 1 if the target's calling sequence or its ABI # create implicit stack probes at or prior to function entry. proc check_effective_target_caller_implicit_probes { } { From patchwork Mon Mar 6 18:47:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 65047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2012211wrd; Mon, 6 Mar 2023 10:48:20 -0800 (PST) X-Google-Smtp-Source: AK7set8pcUDcQm+P9MdfvWpQr7vYpJnsmX9BWk+2EIyiharL7wHUmAnPNG2G3DUSgnoVbEvWyVUe X-Received: by 2002:aa7:cf0d:0:b0:4ae:eae1:1109 with SMTP id a13-20020aa7cf0d000000b004aeeae11109mr10395534edy.2.1678128500299; Mon, 06 Mar 2023 10:48:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678128500; cv=none; d=google.com; s=arc-20160816; b=bJx6OgHh5dMfmNFFC+jq70k/8GowKXSMbVmiXbcCHJtKFMfxHVK67+whFfSS3ISLeU KTHR/LRBVI9NA6KBOlyKTzZqGsXlFoS1zYi7yE4wQq8FagiVShBtg00uVs51Xs6qM5Mx hnFqT6EaJtSFR9Kd7iLmWVw7WZYwDv1kuW/uQa9M/bjAyIVXWA+XaCFKAcaRM25/9Rzd TzAEiXA3Mslr3meEr6WtrbQYhOc2sL2EyOIdY7DKFhuRbPTJ6TmlVaxRlHtzgFHs9zKt X09EDv70OrzqIuDvy0GveRwlj2oxWTLvzpPIW4bLXsL1B5sGknbko+afJMB0hJwnahdX 4XWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :references:content-transfer-encoding:mime-version:subject :in-reply-to:to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=6jGZTsj9iru+VefRcygRB6HN0adr+mC3qaqdu6i4o6g=; b=Pp7BV4ToEoQFWRFBJYvaSjZ0ky1ZI5V8g4q4tEJCxydMFutTH+0s7jxsyW3xCWYNZD LWUaHllSjrIjTThWwUizC8q/mv+vKcNpYyBy8Fnk7zM8bWl86UmmBdz+bwUHwTmRe3An sASd4tmRB3wo2bqeweU1Gl81Wj78xOLxYE3cYP1H9KVfOUP1IHu9px2vQYKj335Yeruc kFd/0soSQQQ6CyalJjOPTIXrCAy2ZWfQihRsNgd2A8SrhaWIhfQybCzVCn7FV7QwACuE mFgIWPnrU66AnwmQ+DsJu2ruZVEliziwpB7gCCYp0ar1LZn6J36R18xEJfVwIxNi7pXH IoWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=RMYPPeZR; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x9-20020aa7d6c9000000b004c1190b5abbsi11305647edr.184.2023.03.06.10.48.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 10:48:20 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=RMYPPeZR; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 21D7E38582A3 for ; Mon, 6 Mar 2023 18:48:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21D7E38582A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678128499; bh=6jGZTsj9iru+VefRcygRB6HN0adr+mC3qaqdu6i4o6g=; h=To:In-Reply-To:Subject:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=RMYPPeZRP7RCnA2x3ki3yrQY0i2RXNjiUU92Y4kI19TBw2McdG1xJ6/MIuxNLoaQJ We+fBoxpIDDFnCfoOnzlFFYTsNDxR96pfDQeZM8X/PeLXfUZ2jQV75FSZ2xNdwzkfg V1aqK4KgJN01JHQFVe8rTqKHGK1XODifgb+HP4DU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 61F053858D39 for ; Mon, 6 Mar 2023 18:47:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 61F053858D39 To: In-Reply-To: <20230306184542.0517B20405@pchp3.se.axis.com> (message from Hans-Peter Nilsson on Mon, 6 Mar 2023 19:45:42 +0100) Subject: [PATCH 2/3] doc: Document testsuite check_effective_target_tail_call MIME-Version: 1.0 References: <20230306184542.0517B20405@pchp3.se.axis.com> Message-ID: <20230306184735.03643203D7@pchp3.se.axis.com> Date: Mon, 6 Mar 2023 19:47:35 +0100 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759645270356381153?= X-GMAIL-MSGID: =?utf-8?q?1759645270356381153?= Will commit as obvious, when the 1/3 tail_call is applied. -- >8 -- Spot-checked the PDF output for sanity. * doc/sourcebuild.texi: Document check_effective_target_tail_call. --- gcc/doc/sourcebuild.texi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index c348a1e47cc3..80bef7f0a0e2 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2844,6 +2844,9 @@ Target supports named sections. Target uses natural alignment (aligned to type size) for types of 32 bits or less. +@item tail_call +Target supports tail-call optimizations. + @item target_natural_alignment_64 Target uses natural alignment (aligned to type size) for types of 64 bits or less. From patchwork Mon Mar 6 18:50:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 65048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp2013362wrd; Mon, 6 Mar 2023 10:50:52 -0800 (PST) X-Google-Smtp-Source: AK7set8SbX/FIVW5KvrfcD5/WNYfdOJuXZ1z4jnEQyT6HlX+odT0XaE4jxuLOPYRF1zlAAGoeP0L X-Received: by 2002:a50:fb85:0:b0:4ab:4d3c:7e99 with SMTP id e5-20020a50fb85000000b004ab4d3c7e99mr11517064edq.2.1678128652411; Mon, 06 Mar 2023 10:50:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678128652; cv=none; d=google.com; s=arc-20160816; b=R3caWKiwfbPWcWNQkQOpBuDz6QbLtlYfLCPbltOIwYcsIwLy1xwFyVnZ0kaFTyTPoa ityqkZjFnm7FSpw+7wvgCpen8nGGkWLmSgdMhb6dVX76jsZEThadMlLuo2ZmH7VypldS UCqJC3Se0kRbao3UZxpxuuohjEPqFAQkY1WaO+13GJHCCDLseSilvOgFx9di5w5Ii4eK piSHf1SKOQ+RqhqmQX5cJjFDn9NzMr7rJwLOKjrfWg883ySuGX9ZxcQ7CoR8mfvpDkVt qEqW8b7J+PbWgrPKyZNiDMATv56/4GdN2t1V/VUUKS+x0StYMgNdZwg/pnPQPkZ0WFJ5 E15A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:date:message-id :references:content-transfer-encoding:mime-version:subject :in-reply-to:to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=NeRjxsltG/IH9zTx5i9hJqV+N/3Nhpsp6AWAelArqnA=; b=0e3DVdXzY70mPW7StXcFNrCpacbUyNq6meuI2nxnBEdRg19WKDX/1Civ4EKzL0e4HX 8syOQ/eNZb4/GCi6RB2MPU2TqGB1z75JlpSqv/wG/eZvpNAdfSuQsS5h75iuCJ8U+jXx Rw4chepf8AXigoL+IvHTnVVNMEn096BIGH7PB+nC6g3PYAflu+cErsicNUd80N6/ULBX w/IZxq9c5C42jRkw7r49vD1+imY+RrvGXv+UxfjRYZ7rmLBvVTOm99IuCUyfaEoZR+n+ 8tM/jYaGmW9LlZ+sKjGEuKHnN6U1Gb7dDB5jMn83hufZ7v2SQcRuf4hDZpTdgSpKxTwE Ta5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qeW1VqqB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id d4-20020a1709064c4400b008b17f6b8c9bsi10086419ejw.86.2023.03.06.10.50.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 10:50:52 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=qeW1VqqB; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3B4F83858D39 for ; Mon, 6 Mar 2023 18:50:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3B4F83858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1678128651; bh=NeRjxsltG/IH9zTx5i9hJqV+N/3Nhpsp6AWAelArqnA=; h=To:In-Reply-To:Subject:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=qeW1VqqBSfGcYmPIyzAfgGEKWrpcH4aeco6J++M3rNpV1Iq2OuTVW96a+U951N1nG y59u58c/oOAWbKXgI0QL6QQxLgWdnJENEh3EaDqriBbpuUfb+hnK1SbtnLp2R+MTYw zC1yJGHqOEvqHtJdicNULou42eBT8ZgCa0U/03TY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by sourceware.org (Postfix) with ESMTPS id 711A13858D39 for ; Mon, 6 Mar 2023 18:50:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 711A13858D39 To: In-Reply-To: <20230306184542.0517B20405@pchp3.se.axis.com> (message from Hans-Peter Nilsson on Mon, 6 Mar 2023 19:45:42 +0100) Subject: [PATCH 3/3] testsuite: Gate gcc.dg/plugin/must-tail-call-1.c and -2.c on tail_call MIME-Version: 1.0 References: <20230306184542.0517B20405@pchp3.se.axis.com> Message-ID: <20230306185008.538C7203D7@pchp3.se.axis.com> Date: Mon, 6 Mar 2023 19:50:08 +0100 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759645429804763483?= X-GMAIL-MSGID: =?utf-8?q?1759645429804763483?= Borderline obvious when tail_call is available, so I'll then apply. -- >8 -- While gcc.dg/plugin/must-tail-call-2.c passes for all targets even without this, the error message is, for a target like cris-elf that doesn't implement sibling calls: "error: cannot tail-call: machine description does not have a sibcall_epilogue instruction pattern" rather than "error: cannot tail-call: callee returns a structure". Also, it'd be confusing to exclude must-tail-call-1.c but not must-tail-call-2.c * gcc.dg/plugin/must-tail-call-1.c, gcc.dg/plugin/must-tail-call-2.c: Gate on effective target tail_call. --- gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c | 1 + gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c | 1 + 2 files changed, 2 insertions(+) diff --git a/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c b/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c index 1495a48232a6..3a6d4cceaba7 100644 --- a/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c +++ b/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c @@ -1,3 +1,4 @@ +/* { dg-do compile { target tail_call } } */ /* { dg-options "-fdelayed-branch" { target sparc*-*-* } } */ extern void abort (void); diff --git a/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c b/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c index c6dfecd32458..d51d15cc0879 100644 --- a/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c +++ b/gcc/testsuite/gcc.dg/plugin/must-tail-call-2.c @@ -1,3 +1,4 @@ +/* { dg-do compile { target tail_call } } */ /* Allow nested functions. */ /* { dg-options "-Wno-pedantic" } */