public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Thomas Schwinge <thomas@codesourcery.com>
To: Tom de Vries <tdevries@suse.de>, <gcc-patches@gcc.gnu.org>,
	Mike Stump <mikestump@comcast.net>,
	Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Subject: [PING] nvptx: stack size limits are relevant for execution only (was: [PATCH, testsuite] Add effective target stack_size)
Date: Fri, 25 Nov 2022 12:09:36 +0100	[thread overview]
Message-ID: <87cz9bl28f.fsf@euler.schwinge.homeip.net> (raw)
In-Reply-To: <87pmdx42bm.fsf@euler.schwinge.homeip.net>

[-- Attachment #1: Type: text/plain, Size: 889 bytes --]

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 <Tom_deVries@mentor.com> wrote:
>> The patch defines an effective target stack_size, which is used in
>> individual test-cases to add -DSTACK_SIZE=<value> [...]
>
>> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-nvptx-stack-size-limits-are-relevant-for-execution-o.patch --]
[-- Type: text/x-diff, Size: 2872 bytes --]

From 158a077129cb1579b93ddf440a5bb60b457e4b7c Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <thomas@codesourcery.com>
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


  reply	other threads:[~2022-11-25 11:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09 14:24 [PATCH, testsuite] Add effective target stack_size Tom de Vries
2017-06-09 15:25 ` Mike Stump
2017-06-12 12:28   ` Christophe Lyon
2017-06-12 14:29     ` Tom de Vries
2017-06-19  9:21       ` Christophe Lyon
2017-06-19 15:42         ` Mike Stump
2017-06-19 17:11   ` Add dg-add-options feature stack_size Tom de Vries
2017-06-19 17:36     ` Mike Stump
2017-06-21 13:19 ` [PATCH, testsuite] Add effective target stack_size Jakub Jelinek
2017-06-21 14:27   ` [testsuite, committed] Support dg-add-options in profopt.exp Tom de Vries
2022-11-08 20:29 ` nvptx: stack size limits are relevant for execution only (was: [PATCH, testsuite] Add effective target stack_size) Thomas Schwinge
2022-11-25 11:09   ` Thomas Schwinge [this message]
2022-12-20  7:55     ` [PING^2] " Thomas Schwinge
2023-01-11 11:45       ` [PING^3] " Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87cz9bl28f.fsf@euler.schwinge.homeip.net \
    --to=thomas@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikestump@comcast.net \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).