From patchwork Mon Oct 16 10:16:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 826222 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-464248-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="xKpBuD3R"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yFvQ00087z9ryQ for ; Mon, 16 Oct 2017 21:17:11 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:cc:message-id:date:mime-version:content-type; q= dns; s=default; b=q3d2H9NXPqM5iRlxnGS8U4wR9LVsVvlRvRLmK4w1brNUX4 yz6+6ZJ0E0vdgC3H1CZmNeUV9sjwFfK7vSKky+p0WEEYports9syZO8m15ciBZ8m RuPuKQmbmk4nGOXQA3K3N1t9tn5CapPjYVHmY4u+OMh6KMbVp7HmoPe88VdSM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:cc:message-id:date:mime-version:content-type; s= default; bh=FZ6K4ldwCXB9VaJD8/XtYaKuDGI=; b=xKpBuD3RKSj8XOm4ulH4 ZP2rXzNETsPafEsdu3M6GegCfF0RILZFpAWBEjD0Rb0TAgYaACDxGYhCFpwuT+8S 4bpgUDbm8g8mu2gRld2Sh1VlBVmp7EN+Wia6oy+VxElIDH0+9ekyNffJfngoOO9q 2fPr/8WhAH8eufLzP0J03MA= Received: (qmail 26860 invoked by alias); 16 Oct 2017 10:17:04 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 26848 invoked by uid 89); 16 Oct 2017 10:17:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 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=HTo:D*comcast.net, HTo:U*ro 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, 16 Oct 2017 10:17:02 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1e42SA-0004WE-RO from Tom_deVries@mentor.com ; Mon, 16 Oct 2017 03:16:58 -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, 16 Oct 2017 11:16:54 +0100 To: Rainer Orth , Mike Stump From: Tom de Vries Subject: [PATCH, testsuite] Add dg-require-stack-size CC: GCC Patches Message-ID: <50f58c99-a635-6aa1-7b6f-cccd990db8ab@mentor.com> Date: Mon, 16 Oct 2017 12:16:51 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 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) Hi, I noticed gcc.dg/tree-ssa/ldist-27.c failing for nvptx due to a too large stack size. I started updating the testcase using "dg-add-options stack_size", but came across dg-require-support and realized I could make a dg-require-stack-size directive with an argument, and use that instead. With the patch applied, the test still passes on x86_64, and by mocking up limited stack space like this: ... ... it's listed as unsupported instead. The info entry looks like: ... 'dg-require-stack-size SIZE' Skip the test if the target does not support a stack size of SIZE. ... OK for trunk? Thanks, - Tom Add dg-require-stack-size 2017-10-16 Tom de Vries * gcc.dg/tree-ssa/ldist-27.c: Use dg-require-stack-size. * lib/target-supports-dg.exp (dg-require-stack-size): New proc. * doc/sourcebuild.texi (Test Directives, Variants of dg-require-support): Add dg-require-stack-size. --- gcc/doc/sourcebuild.texi | 3 +++ gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c | 1 + gcc/testsuite/lib/target-supports-dg.exp | 15 +++++++++++++++ 3 files changed, 19 insertions(+) diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index a2f0429..7d6d4a3 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2358,6 +2358,9 @@ Skip the test if the target does not support the @code{-fstack-check} option. If @var{check} is @code{""}, support for @code{-fstack-check} is checked, for @code{-fstack-check=("@var{check}")} otherwise. +@item dg-require-stack-size @var{size} +Skip the test if the target does not support a stack size of @var{size}. + @item dg-require-visibility @var{vis} Skip the test if the target does not support the @code{visibility} attribute. If @var{vis} is @code{""}, support for @code{visibility("hidden")} is diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c b/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c index 3580c65..dd0e705 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/ldist-27.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O3 -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ +/* { dg-require-stack-size "484000" } */ #define M (300) #define N (200) diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index d50d8b0..999034c 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -180,6 +180,21 @@ proc dg-require-iconv { args } { } } +# If this target does not have sufficient stack size, skip this test. + +proc dg-require-stack-size { args } { + if { ![is-effective-target stack_size] } { + return + } + + set stack_size [dg-effective-target-value stack_size] + set required [lindex $args 1] + if { $stack_size < $required } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # If this target does not support named sections skip this test. proc dg-require-named-sections { args } {