From patchwork Tue Nov 8 20:29:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 17209 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2933548wru; Tue, 8 Nov 2022 12:30:28 -0800 (PST) X-Google-Smtp-Source: AMsMyM4LykmfLqRxjonzpF2MIdcpCw04DXLQDHUWnbGcbhnAcr1prZabN8xRH8uHGDaeyZVeyCcy X-Received: by 2002:a50:ea81:0:b0:463:6cf1:71ed with SMTP id d1-20020a50ea81000000b004636cf171edmr46876783edo.116.1667939428294; Tue, 08 Nov 2022 12:30:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667939428; cv=none; d=google.com; s=arc-20160816; b=y82z6Zs8tQVxlAFF7emGqGiuXe0LI23Hj1tIq32aqS8fWwioZhXAG1vm6MbM2A+An+ 3ykCSTgOBoMQtvjqu6XRWqTs2vC10lpIMOK0YQ+7AQIy3sAIJXWHHmqnLuwxuvs8KTUP eISvAaEekv7iCnfj43zARPmQqb+/SGwX5qOdHtwwbf+WLioGJOrsgX0RijAUXcEPU+Bn nnK7Pu5nPxt0xi48WnTmY/NdEQ0cboHkE4xxeyeaEtglP4LKS8HIPM6S6UU74zk/NGkl D+oD94UKzQl3Fhd+0zu3lwRX5Dq+8t3ZU0OM8OjEZ98xqNSXtcXJxHwbwHuKSN+GEL3W vFkg== 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=f5snT02I6OzuDvLLYBT+Q7NwVUmrria2FV41a9niL38=; b=jqGb2THcf5WNr4P3/qKPtpACXbX+dIbsjrLtywSNJMA2laoapiwG4AtjuM+v6rRw2e 80FuK88Jg38HxTRZRXzNNbLh6hVmg0qpfbqeo0impWjZ94YvqobIbrApmrjxslaBhBU1 QUuBmOw5gNBTjKirmS71iYxQ8vbbo1OJeXGKYyYOsuyX/WfaNB44VMC0UKgQyZn7pwnn 1zvO6oLsEMA99/b6z44riMz0jzGSrhKQRwTCnkRJlv1sLx9wrwvgEm8UXBdl1cXsbx6j hHQ3oZ5ihH7Op0JcyT86ieID6izSth0hXak5DVJbtQrRWUcjVh8OGEw0JGVzA2Z+dBKP ezFA== 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 qk36-20020a1709077fa400b0078db8fe2834si279686ejc.245.2022.11.08.12.30.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 12:30:28 -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 268FF385841D for ; Tue, 8 Nov 2022 20:30:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id CB8E43858D32 for ; Tue, 8 Nov 2022 20:30:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CB8E43858D32 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,148,1665475200"; d="scan'208,223";a="86411893" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 08 Nov 2022 12:29:57 -0800 IronPort-SDR: JUbYz0cph464xHaX0h1v9HflxLpufezfviT0LNqitOUwx+0SDCwONiyZE6E+CGKf/v3DRSRfv/ spUxHKxcFy3sorhu7C3OjZYJgaAZ8aCfkAKdcvU/Kixzu/vkQrepDibIrdNhUrqFOD+U6teiF3 LEApZl0SoMoK44ddDJVaPN7Pm0DG2+N/AnbYUXjmUrC+eNrnK7tcaIxm37Hzg1/heozJ0hU2FK XB+24ox+A7klKuj0CLDLvNKGkstd9JEiTJqf9YWb4sRD09URBxbVVutHywyGdwiZFhiNFxZpm8 vYo= From: Thomas Schwinge To: Tom de Vries , , Mike Stump , Rainer Orth Subject: nvptx: stack size limits are relevant for execution only (was: [PATCH, testsuite] Add effective target stack_size) In-Reply-To: <50077577-1941-e83f-aeb6-e63e1bd2701d@mentor.com> References: <50077577-1941-e83f-aeb6-e63e1bd2701d@mentor.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Tue, 8 Nov 2022 21:29:49 +0100 Message-ID: <87pmdx42bm.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) 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?1748961253919787808?= 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