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 { } {