From patchwork Mon Oct 7 08:22:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1993500 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=iC1e7iPn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XMXFj58Xcz1xtV for ; Mon, 7 Oct 2024 19:22:33 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 799383860C07 for ; Mon, 7 Oct 2024 08:22:31 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id 40C073858D20 for ; Mon, 7 Oct 2024 08:22:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40C073858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 40C073858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::434 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728289332; cv=none; b=gzrzdTdxHSa0VgEuQm8vY5cA97+z1Bwo27UILM2ETEGHnTPyZgCGZ/wxx8JUisLBs1HoDeTpzeeHa6cQnIsyzzf22iokxyfaexFHblE6vIWSQxImMX4WKX4RQkbkHeanVJIOJeZL4TDFaa4zPgPfxBFyESy5iK8d9EQje+lsQCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728289332; c=relaxed/simple; bh=RgyShDNQYaKzSpk8y5DY1k6hJhw2WwJ4P3QNUZbow10=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=phBTKeSFMb9RtdQLdtQYj8/5tD7PL1Qajp1UskzY+/F9LzhQiWcM9ZCSsDGAaoQsiwyZ6Qh4If5Px7wMJKg7XdrmNsoDNrrqCgBOu3zCXjVhEq0xu6ZJTLgGuV4/pOLOVuxvBGhNU8QpxuR1FTCK0tj4rHN6MqPXVujTU4UpLm8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-37cea34cb57so2455860f8f.0 for ; Mon, 07 Oct 2024 01:22:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1728289329; x=1728894129; darn=gcc.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=T/ygP4CYUDaxVX6wmW4U1+jJppzSlfjx+4YvsQihFnc=; b=iC1e7iPnn1Pl9/J9qrrc7DFjFyfjmsNePzkt88SkRqcBeGZsIvLfb0oif+5x/fKszN QWd81ZXPVfZiDKOU6GRQNiQPT8325ae9SMzO4SGFNS80Liqac6OrQmZkdXpQ20sAjin/ 7k+4e3mUjzhAswf96SVphiXT+1vKKHo2pSiq+SMRef9jSYebjpcPn74DpXpN6lTJW3So Jp/Pq6J18Csz5FtxTvqKmvGJOCJvnd8SvfPFIWgeWdaARsz0dDxfeZvglBbQCzI88HYn 8znJmoAA3s3Ohny/fx3fYB49PpZQUALRdNVMzNXxolMaseY9xnXso43UxAboMAXbyqtQ 3KqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728289329; x=1728894129; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=T/ygP4CYUDaxVX6wmW4U1+jJppzSlfjx+4YvsQihFnc=; b=CjBiTTeSe+uEn+Wx5m58akHinLHSi52JwrcyspgXBlCexgML0DZAvHGyLhkMeoay6c bTz3cqVOKgkL+dTCLYuWtwMDDrD1cBEfd7eOZ1qWE8DgWUJSShfWKxq8IpCsZxDmh8gH DbClK08zhJ+z8EdxLJbdTAfccOvrBmcitgCYwrph7WBWfeFO2+uSaSa5fxmOZPeB/PKj f6hXD7MX5V2cGAtG15M5QRWzlhGwNSGyYdQ6DBuijoKoeTw+KUQMZP63R4gmKAcB4caG Jg/N8W7B3RfHSWmduTI6diEfDHkOnrp6C6aUDj0cN3h51uFdt3WukJ/+KX1TfjeheZFF SXUw== X-Gm-Message-State: AOJu0YxwUQ2SbmgXxOGzvaFngmflmx6sCAjKs5ysJIbeuMlBdD+irMwF vmKLWk4++Cq21uoOpplEzmAWI+Eyepluvh7lD8pJi+p/Sh+WQHfAj3Fua+EoMJ3ne1T7lcJI/kp J X-Google-Smtp-Source: AGHT+IFq+CLBo4zrRiINYidJaRmdZDKVPAmvKhNuO4hox1VNio/3/Ugt44PBYUo+EeUT3bimNwQgkw== X-Received: by 2002:a5d:6e85:0:b0:37c:d001:856f with SMTP id ffacd0b85a97d-37d0e7d7752mr6173754f8f.56.1728289328517; Mon, 07 Oct 2024 01:22:08 -0700 (PDT) Received: from euler.schwinge.ddns.net (p200300c8b733b9005e8fc6f38b6af531.dip0.t-ipconnect.de. [2003:c8:b733:b900:5e8f:c6f3:8b6a:f531]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d1698f9c7sm5109128f8f.115.2024.10.07.01.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Oct 2024 01:22:08 -0700 (PDT) From: Thomas Schwinge To: gcc-patches@gcc.gnu.org Cc: Tom de Vries Subject: nvptx: Disable effective-target 'freestanding' (was: [PATCH 3/9] nvptx: Re-enable test cases by removing effective target 'freestanding') In-Reply-To: <20221202120315.803120-4-thomas@codesourcery.com> References: <20221202120315.803120-1-thomas@codesourcery.com> <20221202120315.803120-4-thomas@codesourcery.com> User-Agent: Notmuch/0.30+8~g47a4bad (https://notmuchmail.org) Emacs/29.4 (x86_64-pc-linux-gnu) Date: Mon, 07 Oct 2024 10:22:03 +0200 Message-ID: <87h69oz5jo.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! On 2022-12-02T13:03:09+0100, I wrote: > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > -# 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 > -} I have, for now, pushed a simpler variant of this to trunk branch in commit 65c7616c251a6697134b2a3ac7fe6460d308d2ed "nvptx: Disable effective-target 'freestanding'", see attached. Grüße Thomas From 65c7616c251a6697134b2a3ac7fe6460d308d2ed Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 28 Nov 2022 13:49:06 +0100 Subject: [PATCH] nvptx: Disable effective-target 'freestanding' 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. 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/testsuite/ * gcc.c-torture/execute/printf-1.c: XFAIL for nvptx. * gcc.c-torture/execute/printf-chk-1.c: Likewise. * gcc.c-torture/execute/vprintf-1.c: Likewise. * gcc.c-torture/execute/vprintf-chk-1.c: Likewise. * lib/target-supports.exp (check_effective_target_freestanding): Disable for nvptx. --- gcc/testsuite/gcc.c-torture/execute/printf-1.c | 1 + gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c | 1 + gcc/testsuite/gcc.c-torture/execute/vprintf-1.c | 1 + gcc/testsuite/gcc.c-torture/execute/vprintf-chk-1.c | 1 + gcc/testsuite/lib/target-supports.exp | 3 --- 5 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.c-torture/execute/printf-1.c b/gcc/testsuite/gcc.c-torture/execute/printf-1.c index 654e62766a8..e1201365c1f 100644 --- a/gcc/testsuite/gcc.c-torture/execute/printf-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/printf-1.c @@ -1,4 +1,5 @@ /* { 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-chk-1.c b/gcc/testsuite/gcc.c-torture/execute/printf-chk-1.c index aab43062bae..6418957edae 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,5 @@ /* { 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/vprintf-1.c b/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c index 259397ebda3..0fb1ade94e0 100644 --- a/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c +++ b/gcc/testsuite/gcc.c-torture/execute/vprintf-1.c @@ -1,4 +1,5 @@ /* { 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 04ecc4df4d9..7ea3617e184 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,5 @@ /* { dg-skip-if "requires io" { freestanding } } */ +/* { dg-xfail-run-if {unexpected PTX 'vprintf' return value} { nvptx-*-* } } */ #ifndef test #include diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 459af8e58c6..1c9bbf64817 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -859,9 +859,6 @@ proc check_profiling_available { test_what } { # 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 } -- 2.34.1