From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 109196 invoked by alias); 19 Jun 2017 17:11:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 109174 invoked by uid 89); 19 Jun 2017 17:11:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=wondered, anchors, HTo:D*comcast.net, Hx-languages-length:4191 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 Jun 2017 17:11:06 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1dN0Ci-0005Lh-R2 from Tom_deVries@mentor.com ; Mon, 19 Jun 2017 10:11:09 -0700 Received: from [127.0.0.1] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Mon, 19 Jun 2017 18:11:04 +0100 Subject: Add dg-add-options feature stack_size To: Mike Stump CC: GCC Patches , Rainer Orth References: <50077577-1941-e83f-aeb6-e63e1bd2701d@mentor.com> <62E9DFA1-67E2-442B-8348-61953EAEC5A9@comcast.net> From: Tom de Vries Message-ID: Date: Mon, 19 Jun 2017 17:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <62E9DFA1-67E2-442B-8348-61953EAEC5A9@comcast.net> Content-Type: multipart/mixed; boundary="------------E0717E61E077FEF0BCCC3A47" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-SW-Source: 2017-06/txt/msg01344.txt.bz2 --------------E0717E61E077FEF0BCCC3A47 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1009 [ was: Re: [PATCH, testsuite] Add effective target stack_size ] On 06/09/2017 05:25 PM, Mike Stump wrote: > On Jun 9, 2017, at 7:24 AM, Tom de Vries wrote: >> this patch adds effective target stack_size. >> OK for trunk if x86_64 and nvptx testing succeeds? > Ok. Hi, I came across dg-add-options, and wondered if adding a dg-add-options feature stack_size is a better way to make STACK_SIZE available. Info looks like this: ... 7.2.3.12 Other attributes 'stack_size' Target has limited stack size. The stack size limit can be obtained using the STACK_SIZE macro defined by *note 'dg-add-options' feature 'stack_size': stack_size_ao. 7.2.4 Features for 'dg-add-options' 'stack_size' Add the flags needed to define macro STACK_SIZE and set it to the stack size limit associated with the *note 'stack_size' effective target: stack_size_et. ... Incomplete (updated just one testcase) and untested. OK if complete and tested? Thanks, - Tom --------------E0717E61E077FEF0BCCC3A47 Content-Type: text/x-patch; name="0001-Add-dg-add-options-feature-stack_size.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="0001-Add-dg-add-options-feature-stack_size.patch" Content-length: 3259 Add dg-add-options feature stack_size 2017-06-19 Tom de Vries * doc/sourcebuild.texi (Add Options, Features for dg-add-options): Add stack_size feature. (Effective-Target Keywords, Other attributes): Suggest using dg-add-options stack_size feature to get stack limit in stack_size effective target documentation. * lib/target-supports.exp (add_options_for_stack_size): New proc. * gcc.c-torture/execute/920501-7.c: Use dg-add-options stack_size. --- gcc/doc/sourcebuild.texi | 15 ++++++++++----- gcc/testsuite/gcc.c-torture/execute/920501-7.c | 2 +- gcc/testsuite/lib/target-supports.exp | 11 +++++++++++ 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index e5f0da6..7f5c2cf 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2097,11 +2097,10 @@ Target supports section anchors. Target defaults to short enums. @item stack_size -Target has limited stack size. The stack size limit can be obtained using -@code{[dg-effective-target-value stack_size]}. For example: -@smallexample -/* @{ dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" @{ target @{ stack_size @} @} @} */ -@end smallexample +@anchor{stack_size_et} +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}}. @item static Target supports @option{-static}. @@ -2282,6 +2281,12 @@ compliance mode. @code{mips16} function attributes. Only MIPS targets support this feature, and only then in certain modes. +@item stack_size +@anchor{stack_size_ao} +Add the flags needed to define macro STACK_SIZE and set it to the stack size +limit associated with the @ref{stack_size_et,,@code{stack_size} effective +target}. + @item tls Add the target-specific flags needed to use thread-local storage. @end table diff --git a/gcc/testsuite/gcc.c-torture/execute/920501-7.c b/gcc/testsuite/gcc.c-torture/execute/920501-7.c index 5cced09..1396eeb 100644 --- a/gcc/testsuite/gcc.c-torture/execute/920501-7.c +++ b/gcc/testsuite/gcc.c-torture/execute/920501-7.c @@ -1,6 +1,6 @@ /* { dg-require-effective-target label_values } */ /* { dg-require-effective-target trampolines } */ -/* { dg-additional-options "-DSTACK_SIZE=[dg-effective-target-value stack_size]" { target { stack_size } } } */ +/* { dg-add-options stack_size } */ #ifdef STACK_SIZE #define DEPTH ((STACK_SIZE) / 512 + 1) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 31701c2..502986e 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -7249,6 +7249,17 @@ proc add_options_for_double_vectors { flags } { return $flags } +# Add to FLAGS the flags needed to define the STACK_SIZE macro. + +proc add_options_for_stack_size { flags } { + if [is-effective-target stack_size] { + set stack_size [dg-effective-target-value stack_size] + return "$flags -DSTACK_SIZE=$stack_size" + } + + return $flags +} + # Return 1 if the target provides a full C99 runtime. proc check_effective_target_c99_runtime { } { --------------E0717E61E077FEF0BCCC3A47--