From patchwork Fri Dec 2 12:03:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 28893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp798944wrr; Fri, 2 Dec 2022 04:06:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf6n1cC+TCWH5eRF6s3HsgD2hXe2GnmRrcoR7gMboWLxnn02VbylnVV0vI/pVAFN+fXi3gYG X-Received: by 2002:aa7:cfc4:0:b0:46b:d83e:984c with SMTP id r4-20020aa7cfc4000000b0046bd83e984cmr8137849edy.60.1669982813679; Fri, 02 Dec 2022 04:06:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669982813; cv=none; d=google.com; s=arc-20160816; b=yNJfihAm/1RpGAD+nIpdXgwYfSwd9DD0ZQlsnzguhY5gbK0K2MuLv+beq5rg0dCWGJ A7KeTtF7xoMfAmE7u2DjxsLpjqnD+YdSL5iGirVv7m+DJjRo7OduuwkQyk59Ml/53UqL hjrOPRpWwbceGRNEZHuaBSEXbddr8lnWw8f6/6nHB+2S3cg+KqKilpmJluPKmx83Gz9O VdUKXKbi+eZo8Zn+8zPAs8rYO4+Jb4ZfQQG6RE9JQmD9zfW3NYQqxpwOQSicE9uD0nON cEeIArzHgLWuBblb2iO2IaZy8iDqs4ywqzPdLFO/b+Q6ZK4TcHs/rnfTcTWixHAdSxsz gHWw== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :ironport-sdr:dmarc-filter:delivered-to; bh=u3nS7cEzq/zeHECxiGGP+1RM+bP8P4AckNKpoHL+EXk=; b=YdBEpmHuKLIr9JqMVBAC6uc45dijIYnhTdBxW3N6dM4/R+9Qhl0tnfbqaUuTYeVuEj g+/dq8WzOBdNCFbBUO+dH4UlAJ+zwQ4rgx7layX1EAq89abF7gBsWMSUVOUzRV86pCHA e4i4YIH9LYArayd0qavMLWHoXNgzB3QgAURXaHbFMJjM+B+0+288DdnhO/FzeisLWJ+J IGdADUaBxlciHGy9/8MosQL5DSp1kl+ADwntyiCvngY9WnJmjvyVfh38GO+tClev31EY EKWv/gjNdQdVuBr5UQWyi4Ou9TZyRYIX6IjNQb9el+mhnFscq86NzFO1VhIaJgH1ekLz LS7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h12-20020a05640250cc00b004692dec65dbsi296632edb.259.2022.12.02.04.06.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 04:06:53 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 75FA63854575 for ; Fri, 2 Dec 2022 12:04:34 +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 2A7083858425 for ; Fri, 2 Dec 2022 12:03:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2A7083858425 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,212,1665475200"; d="scan'208";a="91487263" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 02 Dec 2022 04:03:34 -0800 IronPort-SDR: 3+00mIcVa706CHyxUBu2Wr5vGD+DOoaDC3he7/K2MMwy3C1abzSJfeGzjPuo93pS/RmxqKAwWV xEBmNyWyIMT74YqmvyWGnaTMekceEU2tMYqT1sgAJMQA2hanzie//jOyzv9Lbsnlo530Aod+Az xBqQ9cTXaLlgY3ZqJLUrtp34yN/vdHu9YSUkVGuS83Lq/+zBEWgSNMpYWKWzXOKyVykapuIm9l 3bJJdChIavl2zjFD0H4RzPqszNNnDf3LZ4tQ3KDyOhVPkHvzQYOeod5Yqe6NvDWdWr1UtBz7ej edQ= From: Thomas Schwinge To: , Subject: [PATCH 3/9] nvptx: Re-enable test cases by removing effective target 'freestanding' Date: Fri, 2 Dec 2022 13:03:09 +0100 Message-ID: <20221202120315.803120-4-thomas@codesourcery.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221202120315.803120-1-thomas@codesourcery.com> References: <20221202120315.803120-1-thomas@codesourcery.com> 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?1751103898553183970?= X-GMAIL-MSGID: =?utf-8?q?1751103898553183970?= After 2014's commit 157e859ffe3b5d43db1e19475711c1a3d21ab57a "remove picochip", the effective target 'freestanding' (later) was only ever used for nvptx. However, the relevant I/O library functions have long been implemented in nvptx newlib, and otherwise, the more specific effective target 'fileio' (as added in commit r10-7943-g3685c5adf5c0b30268cb8f95c89e4c4a3240ae6f "introduce target fileio and require it in tests that use tmpnam") may be used, and already is used in the relevant test cases. Therefore, I suggest "removing effective target 'freestanding'" instead of letting it linger unused, and thus unmaintained. These test cases generally PASS, just a few need to get XFAILed; see , and then supposedly for description of the non-standard PTX 'vprintf' return value: > Unlike the C-standard 'printf()', which returns the number of characters > printed, CUDA's 'printf()' returns the number of arguments parsed. If no > arguments follow the format string, 0 is returned. If the format string is > NULL, -1 is returned. If an internal error occurs, -2 is returned. (I've tried a few variants to confirm that PTX 'vprintf' -- which supposedly is underlying the CUDA 'printf' -- is what's implementing this behavior.) Probably, we ought to fix that up in nvptx newlib. gcc/doc/ * sourcebuild.texi (Effective-Target Keywords): Remove 'freestanding'. gcc/testsuite/ * gcc.c-torture/execute/builtins/fprintf.x: Remove. * gcc.c-torture/execute/builtins/fputs.x: Likewise. * gcc.c-torture/execute/complex-6.c: Don't gate on 'freestanding'. * gcc.c-torture/execute/fprintf-1.c: Likewise. * gcc.c-torture/execute/fprintf-2.c: Likewise. * gcc.c-torture/execute/fprintf-chk-1.c: Likewise. * gcc.c-torture/execute/gofast.c: Likewise. * gcc.c-torture/execute/pr34456.c: Likewise. * gcc.c-torture/execute/printf-1.c: Likewise. * gcc.c-torture/execute/printf-2.c: Likewise. * gcc.c-torture/execute/printf-chk-1.c: Likewise. * gcc.c-torture/execute/user-printf.c: Likewise. * gcc.c-torture/execute/vfprintf-1.c: Likewise. * gcc.c-torture/execute/vfprintf-chk-1.c: Likewise. * gcc.c-torture/execute/vprintf-1.c: Likewise. * gcc.c-torture/execute/vprintf-chk-1.c: Likewise. * gcc.dg/pr27531-1.c: Likewise. * gcc.dg/pr44606.c: Likewise. * lib/target-supports.exp (check_effective_target_freestanding): Remove. --- gcc/doc/sourcebuild.texi | 5 ----- gcc/testsuite/gcc.c-torture/execute/builtins/fprintf.x | 7 ------- gcc/testsuite/gcc.c-torture/execute/builtins/fputs.x | 7 ------- gcc/testsuite/gcc.c-torture/execute/complex-6.c | 2 -- gcc/testsuite/gcc.c-torture/execute/fprintf-1.c | 2 -- gcc/testsuite/gcc.c-torture/execute/fprintf-2.c | 3 +-- gcc/testsuite/gcc.c-torture/execute/fprintf-chk-1.c | 2 -- gcc/testsuite/gcc.c-torture/execute/gofast.c | 2 -- gcc/testsuite/gcc.c-torture/execute/pr34456.c | 2 -- gcc/testsuite/gcc.c-torture/execute/printf-1.c | 2 +- gcc/testsuite/gcc.c-torture/execute/printf-2.c | 3 +-- gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c | 2 +- gcc/testsuite/gcc.c-torture/execute/user-printf.c | 3 +-- gcc/testsuite/gcc.c-torture/execute/vfprintf-1.c | 2 -- gcc/testsuite/gcc.c-torture/execute/vfprintf-chk-1.c | 2 -- gcc/testsuite/gcc.c-torture/execute/vprintf-1.c | 2 +- gcc/testsuite/gcc.c-torture/execute/vprintf-chk-1.c | 2 +- gcc/testsuite/gcc.dg/pr27531-1.c | 1 - gcc/testsuite/gcc.dg/pr44606.c | 1 - gcc/testsuite/lib/target-supports.exp | 10 ---------- 20 files changed, 7 insertions(+), 55 deletions(-) delete mode 100644 gcc/testsuite/gcc.c-torture/execute/builtins/fprintf.x delete mode 100644 gcc/testsuite/gcc.c-torture/execute/builtins/fputs.x -- 2.35.1 ----------------- 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 diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index fc488964480f..cfdd5cfe1a6f 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2623,11 +2623,6 @@ Target offers such file I/O library functions as @code{fopen}, requirement for the presence of the functions in the library; even if they fail at runtime, the requirement is still regarded as satisfied. -@item freestanding -Target is @samp{freestanding} as defined in section 4 of the C99 standard. -Effectively, it is a target which supports no extra headers or libraries -other than what is considered essential. - @item gettimeofday Target supports @code{gettimeofday}. diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/fprintf.x b/gcc/testsuite/gcc.c-torture/execute/builtins/fprintf.x deleted file mode 100644 index c8fdaf5b2547..000000000000 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/fprintf.x +++ /dev/null @@ -1,7 +0,0 @@ -load_lib target-supports.exp - -if { [check_effective_target_freestanding] } { - return 1; -} - -return 0; diff --git a/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.x b/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.x deleted file mode 100644 index c8fdaf5b2547..000000000000 --- a/gcc/testsuite/gcc.c-torture/execute/builtins/fputs.x +++ /dev/null @@ -1,7 +0,0 @@ -load_lib target-supports.exp - -if { [check_effective_target_freestanding] } { - return 1; -} - -return 0; diff --git a/gcc/testsuite/gcc.c-torture/execute/complex-6.c b/gcc/testsuite/gcc.c-torture/execute/complex-6.c index 75f921080886..082c7e7cf514 100644 --- a/gcc/testsuite/gcc.c-torture/execute/complex-6.c +++ b/gcc/testsuite/gcc.c-torture/execute/complex-6.c @@ -1,5 +1,3 @@ -/* { dg-skip-if "requires io" { freestanding } } */ - /* This test tests complex conjugate and passing/returning of complex parameter. */ diff --git a/gcc/testsuite/gcc.c-torture/execute/fprintf-1.c b/gcc/testsuite/gcc.c-torture/execute/fprintf-1.c index 15996ef22c51..f16252b1e8e6 100644 --- a/gcc/testsuite/gcc.c-torture/execute/fprintf-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/fprintf-1.c @@ -1,5 +1,3 @@ -/* { dg-skip-if "requires io" { freestanding } } */ - #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c b/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c index 00517d1d1acf..edcbd1ed631f 100644 --- a/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/fprintf-2.c @@ -3,8 +3,7 @@ The calls can still be transformed into those of other functions. { dg-require-effective-target fileio } { dg-prune-output "warning: warning: \[^\n\r\]* possibly used unsafely" } - { dg-skip-if "requires io" { avr-*-* } } - { dg-skip-if "requires io" { freestanding } } */ + { dg-skip-if "requires io" { avr-*-* } } */ #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/fprintf-chk-1.c b/gcc/testsuite/gcc.c-torture/execute/fprintf-chk-1.c index 6f9e62c39e72..918ff8e5689a 100644 --- a/gcc/testsuite/gcc.c-torture/execute/fprintf-chk-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/fprintf-chk-1.c @@ -1,5 +1,3 @@ -/* { dg-skip-if "requires io" { freestanding } } */ - #include #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/gofast.c b/gcc/testsuite/gcc.c-torture/execute/gofast.c index 72774f16e740..f55ced22073b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/gofast.c +++ b/gcc/testsuite/gcc.c-torture/execute/gofast.c @@ -1,5 +1,3 @@ -/* { dg-skip-if "requires io" { freestanding } } */ - /* Program to test gcc's usage of the gofast library. */ /* The main guiding themes are to make it trivial to add test cases over time diff --git a/gcc/testsuite/gcc.c-torture/execute/pr34456.c b/gcc/testsuite/gcc.c-torture/execute/pr34456.c index b4a845ec14b1..526c954e55ad 100644 --- a/gcc/testsuite/gcc.c-torture/execute/pr34456.c +++ b/gcc/testsuite/gcc.c-torture/execute/pr34456.c @@ -1,5 +1,3 @@ -/* { dg-skip-if "requires qsort" { freestanding } } */ - #include int __attribute__ ((noinline)) debug (void) { return 1; } diff --git a/gcc/testsuite/gcc.c-torture/execute/printf-1.c b/gcc/testsuite/gcc.c-torture/execute/printf-1.c index 654e62766a85..77c4b87009eb 100644 --- a/gcc/testsuite/gcc.c-torture/execute/printf-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/printf-1.c @@ -1,4 +1,4 @@ -/* { dg-skip-if "requires io" { freestanding } } */ +/* { dg-xfail-run-if {unexpected PTX 'vprintf' return value} { nvptx-*-* } } */ #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/printf-2.c b/gcc/testsuite/gcc.c-torture/execute/printf-2.c index 2087bba84482..6e060773f83b 100644 --- a/gcc/testsuite/gcc.c-torture/execute/printf-2.c +++ b/gcc/testsuite/gcc.c-torture/execute/printf-2.c @@ -4,8 +4,7 @@ { dg-require-effective-target unwrapped } { dg-require-effective-target fileio } { dg-prune-output "warning: warning: \[^\n\r\]* possibly used unsafely" } - { dg-skip-if "requires io" { avr-*-* } } - { dg-skip-if "requires io" { freestanding } } */ + { dg-skip-if "requires io" { avr-*-* } } */ #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c b/gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c index aab43062baef..a9fb5eea63df 100644 --- a/gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c @@ -1,4 +1,4 @@ -/* { dg-skip-if "requires io" { freestanding } } */ +/* { dg-xfail-run-if {unexpected PTX 'vprintf' return value} { nvptx-*-* } } */ #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/user-printf.c b/gcc/testsuite/gcc.c-torture/execute/user-printf.c index bfee0760dd74..683aaf272589 100644 --- a/gcc/testsuite/gcc.c-torture/execute/user-printf.c +++ b/gcc/testsuite/gcc.c-torture/execute/user-printf.c @@ -4,8 +4,7 @@ { dg-require-effective-target unwrapped } { dg-require-effective-target fileio } { dg-prune-output "warning: warning: \[^\n\r\]* possibly used unsafely" } - { dg-skip-if "requires io" { avr-*-* } } - { dg-skip-if "requires io" { freestanding } } */ + { dg-skip-if "requires io" { avr-*-* } } */ #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/vfprintf-1.c b/gcc/testsuite/gcc.c-torture/execute/vfprintf-1.c index 0ac41dee3d6f..c00380425425 100644 --- a/gcc/testsuite/gcc.c-torture/execute/vfprintf-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/vfprintf-1.c @@ -1,5 +1,3 @@ -/* { dg-skip-if "requires io" { freestanding } } */ - #ifndef test #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/vfprintf-chk-1.c b/gcc/testsuite/gcc.c-torture/execute/vfprintf-chk-1.c index 401eaf4304a4..f8f964c7e9af 100644 --- a/gcc/testsuite/gcc.c-torture/execute/vfprintf-chk-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/vfprintf-chk-1.c @@ -1,5 +1,3 @@ -/* { dg-skip-if "requires io" { freestanding } } */ - #ifndef test #include #include diff --git a/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c b/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c index 259397ebda39..5c6208dd114d 100644 --- a/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c @@ -1,4 +1,4 @@ -/* { dg-skip-if "requires io" { freestanding } } */ +/* { dg-xfail-run-if {unexpected PTX 'vprintf' return value} { nvptx-*-* } } */ #ifndef test #include diff --git a/gcc/testsuite/gcc.c-torture/execute/vprintf-chk-1.c b/gcc/testsuite/gcc.c-torture/execute/vprintf-chk-1.c index 04ecc4df4d93..bb321ba6908c 100644 --- a/gcc/testsuite/gcc.c-torture/execute/vprintf-chk-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/vprintf-chk-1.c @@ -1,4 +1,4 @@ -/* { dg-skip-if "requires io" { freestanding } } */ +/* { dg-xfail-run-if {unexpected PTX 'vprintf' return value} { nvptx-*-* } } */ #ifndef test #include diff --git a/gcc/testsuite/gcc.dg/pr27531-1.c b/gcc/testsuite/gcc.dg/pr27531-1.c index b1ea748acb27..04672045b581 100644 --- a/gcc/testsuite/gcc.dg/pr27531-1.c +++ b/gcc/testsuite/gcc.dg/pr27531-1.c @@ -4,7 +4,6 @@ output to reference a label that had been eliminated. */ /* { dg-do link } */ /* { dg-options "-O2" } */ -/* { dg-skip-if "requires io" { freestanding } } */ typedef struct _IO_FILE FILE; char const *RCSname; diff --git a/gcc/testsuite/gcc.dg/pr44606.c b/gcc/testsuite/gcc.dg/pr44606.c index 13cc3efc1939..3929775535e0 100644 --- a/gcc/testsuite/gcc.dg/pr44606.c +++ b/gcc/testsuite/gcc.dg/pr44606.c @@ -1,7 +1,6 @@ /* PR target/44606 */ /* { dg-do run } */ /* { dg-options "-O2" } */ -/* { dg-skip-if "requires io" { freestanding } } */ #include diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 555d6dde505a..d2de761adb5d 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -830,16 +830,6 @@ proc check_profiling_available { test_what } { return $profiling_working } -# Check to see if a target is "freestanding". This is as per the definition -# in Section 4 of C99 standard. Effectively, it is a target which supports no -# extra headers or libraries other than what is considered essential. -proc check_effective_target_freestanding { } { - if { [istarget nvptx-*-*] } { - return 1 - } - return 0 -} - # Check to see that file I/O functions are available. proc check_effective_target_fileio { } { return [check_no_compiler_messages fileio_available executable {