From patchwork Wed Jan 11 11:45:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 41930 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3271130wrt; Wed, 11 Jan 2023 03:46:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXtGkTjg1XQeUxqWAJ6SZhLX5kIQLMSPO/YVtmbHeoI917VqsL0Svb+NjRRtYfy1IYNwhz6C X-Received: by 2002:a17:906:148a:b0:7cd:dbe8:e4f7 with SMTP id x10-20020a170906148a00b007cddbe8e4f7mr61207384ejc.77.1673437581871; Wed, 11 Jan 2023 03:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673437581; cv=none; d=google.com; s=arc-20160816; b=c41hYXMFVhOLtZ+0FOxc4BAdUGifSJK2wIzgA6o1oJ52ZxRbjth6Y2TAMJIlZVPSmo 7X1J5Fc22T6xZwxodFj5jvCk7fVBUk1O32eWseI7qEtcxRxyJR37eFWJJzOFKwAyZhRX IJyn0Dsgj0FEr/yVT2ryLqAUqDZ0Olf4hJH3PWhOvHIjqJ63F7OZePiR+6YHFP9JFa/L IgVM3PsjxQdbWQTdjocZUc3EYIZ2bRPzRwmwweZD6INTa/DD0/mEGtYrBw+/HLxMDbYN j92JSGAn4+xv0RmqQF7/6ZKkkaArkO0lauj3Zn2rX2g91l82Vsw7AlbkaSBFpUaS5DJv p0VQ== 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=/wKqjjSG8m3avjGhxpLZkYL2wZW2ZAd3yNTFAId6yCs=; b=bU2HuTFgWvLI+hlyZqrwpLWsQlIJu4/nBdj6/CSDiAXqfeg1k+LCaGfQdiFp7+UuaY 3ifu8Q1f4LWkrwvT1oNKtsShOvzAPTV8L0rzotPBkmu/oLO5grYBDcUGYT9xe78WWNxQ 7JdgNsoF6yC2UyOoKC4VjSWYUJL20rPems7Pwrf5o3dcPbzfyVnTmdv9aIHspOaKzeFd LcnuPktb0GjNlndt1FvyrnAaedNdcHRMPueyq+MReZN2c5EzZi8XahGpJbIYiWQZDc0r 3GhDSovnHqb3UpcfIzEYRtFlA/T6b4BE+IoQNpj3ZU+Jjrz7TGsMu+0+CpoAnFlMcZnn aERw== 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 sh15-20020a1709076e8f00b0084514612c23si15962576ejc.648.2023.01.11.03.46.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 03:46:21 -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 BEE7438493CB for ; Wed, 11 Jan 2023 11:46:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id BE90C3858C83 for ; Wed, 11 Jan 2023 11:45:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE90C3858C83 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,315,1665475200"; d="scan'208,223";a="92919791" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 11 Jan 2023 03:45:46 -0800 IronPort-SDR: rzguvijK2ebeYxTELZPjj0LWi4TozItf8ShY9IvLGTnf2fGcr7WXubmwBHKsZCmnjKh1zILjVq cAFNkSccKGjR/JrzryYQt+Z2cZGfHc9MO/fIospFVVRumAkbhsI8JtqiK+k+K31U+e8I0bsojb 1gQs7OIy00en/inZ34w0io2M7gy1plvHJaD1w6V6xsqum+07yW26CSzKLdB36EF/Xj1ro2ETVG NlI6ZLf6Fckv0zcfBSQJ9PElB/rPBXaVrocYEclI+zT7XiixAkeSfAcQKWhaTUBHcp3Ookk3Wv aZY= From: Thomas Schwinge To: Tom de Vries , , Mike Stump , Rainer Orth Subject: [PING^3] nvptx: stack size limits are relevant for execution only (was: [PATCH, testsuite] Add effective target stack_size) In-Reply-To: <87len2cxwj.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> <87len2cxwj.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Wed, 11 Jan 2023 12:45:39 +0100 Message-ID: <87lem9l2fw.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) 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?1754726485832354191?= Hi! Ping. Grüße Thomas On 2022-12-20T08:55:08+0100, I wrote: > 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