From patchwork Tue Dec 20 07:55:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 34973 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2830509wrn; Mon, 19 Dec 2022 23:55:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf6MLxPZhPG4XgJuctCIyGPLSctg0lngrBlGgnvfoC5HkvBEdK7ZcA+YZyokW9qBahdyRX5t X-Received: by 2002:a05:6402:5303:b0:467:9976:2e38 with SMTP id eo3-20020a056402530300b0046799762e38mr29040155edb.18.1671522951372; Mon, 19 Dec 2022 23:55:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671522951; cv=none; d=google.com; s=arc-20160816; b=WtIVlJt2FtGkQLa6XZcZHcEb/F/RFBnY7gRBTzWSLCRbek3NvpGkW+dmgOaWm16BJA xwSK2lZb2xi6WWrW8aB/PXmAnEwLlgmTR/TCZZ3dvshXOKxEab8bc6njMFBcIM+kcZp8 IxmHbsdA4iS2uvyuyqFCM44+spu10tO845XGzGW03SrUSZOi+qVEb32ZpuTu3p4jhKQI nhxKTKO7FNQr6TfHmqJ6MUoi55Q6qNr+QcjKJTnZaaCvywQr+QHl0V6w7t+Dt2v442v0 1lALPYymki9QumA1O21AZb2KRrfnYFWBTwMFhKAM7tnQG9lIbPX2xSkVgJx7/st+lWWP xDLw== 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=KYKj7AwEdXpTUQhFfWYpx/Xc+WCGE6bwQuUg3Z7wuwc=; b=0Y2ZtsAF+l2qo2ufrKqG8Nxn8P++lW4nMnCtK64iqACqWMMxyiTbWRGhWC2OMdvBVl 8+MhaU5YC6+qITGyaNC+iHT17kdQlS5nLeJeXNleiUSKhFuV7RrL9ZKEizh4fEHgNcWN RuyzWv+PY6RAk5rKWQgAH+0J8xvbymC3FJlb3aiRGP0qdK+QkWfKDGl++cxs4FMY0Fki grKn2jfuU5FpPm2KOSQRC8hKHwRoUWm9hM8+da3DW77rtNZiCslQGRp8689SDZzhOKmT rFvTFATj46Hn3jlAJIW5N67BR+nsbj0NYtGQ/ArMzvDN1WCOcCJzLfoAyfum3pVFrT6t agig== 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 hq15-20020a1709073f0f00b007ea638b5670si10638266ejc.485.2022.12.19.23.55.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 23:55:51 -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 3816E3858408 for ; Tue, 20 Dec 2022 07:55:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id 643393858D28 for ; Tue, 20 Dec 2022 07:55:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 643393858D28 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,258,1665475200"; d="scan'208,223";a="93586608" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 19 Dec 2022 23:55:18 -0800 IronPort-SDR: 8fEA0sX1C3mL1sci5ncQGnNPpsg+kwGpCMduMqRhgQb/yxEKw7Cz8tmpq40eivsNVvjmqF51dO 4TBWGGp/bDqxI6PNEZ6cujcA6Zt/XcZHxJjrbXDrPohnxBjC23baOOSW6lh6/lgJLbO7F7cHNB tbPXq9EHBaouPqF/JV6rvH9sxyQK0kPjytP6TLuaPQDkUfs385eetWQg1ox/SaTPYwEYXBVFwW kWsvAlQJsBK6aTOjK1IieVTBAHX9Yk+PHTWG2Sf1fXimd0zRvjd/5peII04Gjkl+7QOFexrxKu UhI= From: Thomas Schwinge To: Tom de Vries , , Mike Stump , Rainer Orth Subject: [PING^2] nvptx: stack size limits are relevant for execution only (was: [PATCH, testsuite] Add effective target stack_size) In-Reply-To: <87cz9bl28f.fsf@euler.schwinge.homeip.net> References: <50077577-1941-e83f-aeb6-e63e1bd2701d@mentor.com> <87pmdx42bm.fsf@euler.schwinge.homeip.net> <87cz9bl28f.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: Tue, 20 Dec 2022 08:55:08 +0100 Message-ID: <87len2cxwj.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-14.mgc.mentorg.com (139.181.222.14) 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, 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?1752718850398203408?= Hi! Ping. Grüße Thomas On 2022-11-25T12:09:36+0100, I wrote: > 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