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: 62176 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7113F3858C62 for ; Tue, 20 Dec 2022 07:55:39 +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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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