From patchwork Fri Nov 25 11:09:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 25930 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3931187wrr; Fri, 25 Nov 2022 03:10:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf7URhziX57aT3yPDvL9oG2ltVUZ2S2nI5nDmOgUw45HnRvw+LbC36Ix5dmuMZUedHW3pvTK X-Received: by 2002:a17:906:4e04:b0:78d:9b4f:44ee with SMTP id z4-20020a1709064e0400b0078d9b4f44eemr14864729eju.679.1669374624168; Fri, 25 Nov 2022 03:10:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669374624; cv=none; d=google.com; s=arc-20160816; b=B/IXIAbs6MvmuzQFUAanZQNxL17ohHQkNPKKTI6WVeVV4g+qENwWExgX9g0IjA9cSh wPfreMuQrqzwykI7Mhbt6jxoN7ew5ky6BnQp2fJNgVncFAbIOUbo/U07b9v8cPJ5MW+B RxwQWD1gst+stLHuZ2ECrzQZKjJspM/Y4OoTg+vbzSnUZlbH0dlZBdEcWBaluw7QgTlC 8wcrZorybof2VdCfSBVjUiykdscgb2ttHVJO4v00XHUvrjg96T9uaqEooA0nHAO4I980 y9q+77fTM4WbT+NAIaVnAnEMpM/zyDr8OhLqkSjkj1EcEVG4d5a1EcSdvxirqPdGDuX5 AFGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:references:in-reply-to:subject:to:from:ironport-sdr :dmarc-filter:delivered-to; bh=l4dbs6Nx5vdGepRK+pltZBJTfRbd5uLtykJEaJX3KFY=; b=RnllBMnXJxrTcYk0LraEwCzqHsBPJitnOJY9cO5VPEnWzFgmbsrjzhSRBBUukpAG9S pHQA9+LZC7sxkaTQQ+QutAFBwv5/NpYmXW207f59f6xi8dfJ6HfcwwA+uqXYsHeavTgb qdihM+C8UiulwE4FKQeOIpO4tWUs/gUg9nmxVXbO/WZb7LW5ifrV2e2PZvHXiJCB+x+/ mRlOfi0xwGblMivwETanSymdPvdHjlxpnaFDV36jJ40mr+mB15NOt/+Qs7KgsZeQU93e YplY0QrHCLhkmLeZoercWJLQ2EztFzTqNXamxaipw+RgmSOC9oqJNXCycZJZydx2YfrQ SFYw== ARC-Authentication-Results: i=1; mx.google.com; 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" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id ml21-20020a170906cc1500b007b299051a9fsi1934253ejb.192.2022.11.25.03.10.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 03:10:24 -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; 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 89600384F8B3 for ; Fri, 25 Nov 2022 11:10:19 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 8992538532F3 for ; Fri, 25 Nov 2022 11:09:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8992538532F3 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.96,193,1665475200"; d="scan'208,223";a="88112056" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 25 Nov 2022 03:09:54 -0800 IronPort-SDR: M1aNZntjN7hA7jCatKpl8lpFwHIzzYBE47J3EzCdNHdEem+/6UyT5/PwXemg2RX1sWFWe94kDS 6NT2zCvZiDpDgr6hEzyOZHYKcW50OZshQIWd4F/ugYE/SadLe9NmBarogS2okPnSer4idjeWQi N50AhA83ChxrIXiqErkZRqHEYN/kYsdOPrfhVwfSmA7A9BPA5qScjgMG1o4Zm9Xy2ZeKMJ7QxJ iHqFq6cJlLmsFqO1ZfdrA27p36U9Q/ED/MUdSM2rC0WbOPjd0QVjrAme+2RuonEHMedBsyG9mW 6eY= From: Thomas Schwinge To: Tom de Vries , , Mike Stump , Rainer Orth Subject: [PING] nvptx: stack size limits are relevant for execution only (was: [PATCH, testsuite] Add effective target stack_size) In-Reply-To: <87pmdx42bm.fsf@euler.schwinge.homeip.net> References: <50077577-1941-e83f-aeb6-e63e1bd2701d@mentor.com> <87pmdx42bm.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Fri, 25 Nov 2022 12:09:36 +0100 Message-ID: <87cz9bl28f.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H2, 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: , 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?1748961253919787808?= X-GMAIL-MSGID: =?utf-8?q?1750466166003269211?= Hi! Ping. Grüße Thomas On 2022-11-08T21:29:49+0100, I wrote: > Hi! > > On 2017-06-09T16:24:30+0200, Tom de Vries wrote: >> The patch defines an effective target stack_size, which is used in >> individual test-cases to add -DSTACK_SIZE= [...] > >> gccint.info (edited for long lines): >> ... >> 7.2.3.12 Other attributes >> ......................... >> >> 'stack_size' >> Target has limited stack size. [...] > > On top of that, OK to push the attached > "nvptx: stack size limits are relevant for execution only"? > > > Grüße > Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 158a077129cb1579b93ddf440a5bb60b457e4b7c Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Tue, 8 Nov 2022 12:10:03 +0100 Subject: [PATCH] nvptx: stack size limits are relevant for execution only For non-'dg-do run' test cases, that means: big 'dg-require-stack-size' need not be UNSUPPORTED (and indeed now do all PASS), 'dg-add-options stack_size' need not define (and thus limit) 'STACK_SIZE' (and still do all PASS). Re "Find 'dg-do-what' in an outer frame", currently (sources not completely clean, though), we've got: $ git grep -F 'check_effective_target_stack_size: found dg-do-what at level ' -- build-gcc/\*.log | sort | uniq -c 6 build-gcc/gcc/testsuite/gcc/gcc.log:check_effective_target_stack_size: found dg-do-what at level 2 267 build-gcc/gcc/testsuite/gcc/gcc.log:check_effective_target_stack_size: found dg-do-what at level 3 239 build-gcc/gcc/testsuite/gcc/gcc.log:check_effective_target_stack_size: found dg-do-what at level 4 gcc/testsuite/ * lib/target-supports.exp (check_effective_target_stack_size): For nvptx target, stack size limits are relevant for execution only. gcc/ * doc/sourcebuild.texi (stack_size): Update. --- gcc/doc/sourcebuild.texi | 4 ++++ gcc/testsuite/lib/target-supports.exp | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 137f00aadc1f..5bbf6fc55909 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2848,6 +2848,10 @@ Target has limited stack size. The stack size limit can be obtained using the STACK_SIZE macro defined by @ref{stack_size_ao,,@code{dg-add-options} feature @code{stack_size}}. +Note that for certain targets, stack size limits are relevant for +execution only, and therefore considered only if @code{dg-do run} is +in effect, otherwise unlimited. + @item static Target supports @option{-static}. diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 750897d08548..39ed1723b03a 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -625,6 +625,22 @@ proc check_effective_target_trampolines { } { # Return 1 if target has limited stack size. proc check_effective_target_stack_size { } { + # For nvptx target, stack size limits are relevant for execution only. + if { [istarget nvptx-*-*] } { + # Find 'dg-do-what' in an outer frame. + set level 1 + while true { + upvar $level dg-do-what dg-do-what + if [info exists dg-do-what] then break + incr level + } + verbose "check_effective_target_stack_size: found dg-do-what at level $level" 2 + + if { ![string equal [lindex ${dg-do-what} 0] run] } { + return 0 + } + } + if [target_info exists gcc,stack_size] { return 1 } -- 2.35.1