From patchwork Wed Sep 4 09:54:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1980560 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=QnqjiBjZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4WzHsJ3nTMz1yfv for ; Wed, 4 Sep 2024 19:54:44 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35EE0386100A for ; Wed, 4 Sep 2024 09:54:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 303483858424 for ; Wed, 4 Sep 2024 09:54:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 303483858424 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 303483858424 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::436 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725443660; cv=none; b=lMg7wUVGLI6oGGoM1FSM3T5T2VJdUgCqXjoMzKSFIQtdfiS4fnXw/wLw47woiHKpH2oCgppV+LGRtG4ZxDw+1Szy5xCJZGcC/aUolSTYPkel93JubGc6CGKHgenXH1GI142f1Apv5zpcUuwxdh2xh7ibh2ygeRVe/Z3zC/oFK+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725443660; c=relaxed/simple; bh=uAWgetKU+QNYSk0oZVUf/0NYWvbDuA1YBMpBaq1mfg8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=NXQQIwl9mDSeQwLFvWhzvrrCgKNNRv1a9CS2mbD/jo1KFMU6oqZ0yqJ20/sPnBkobdu0OkA5TjIdTB3L7L8ObDPyAbdT5Oot+u2+2zY35pAipWyQ6pjjuzY8Hj4jH1T3MYotS4KAPqkyqJex2typEozHSpz9nejOv4kyomaRsEI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-374c1963cb6so2350556f8f.3 for ; Wed, 04 Sep 2024 02:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725443657; x=1726048457; darn=gcc.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZgLa9SdUIAi6e7ik6JqpM2eYBsOTolxt6NO9uP1zYZo=; b=QnqjiBjZTycREWvxA5OuYEi5DIJSala90AmCDEReZHgeV/h54QOuv10ZZO88qDVF1p R/yiG2SHyeKEGU6rBmDsXcngnuxlHozfanxFkN3bVYIZDYpqkoNr3ke8Rjw1dr8F5lEj JVkL8paG9rekD1KeM3Gt2bRsdqiIoVGdxjNc2iBp9OSFrPx0iUvkF8mghDqVoODYp5CL UA4iZYruU0QldBn2wLxSi87flMqAXpozfakfcZFSXu/dUtWcfODmSAM7shiBgbLzfsS8 QxI6rmrSidguqtPrKA65uKQPLsC6bQLUJe36alArefQqufrl4IDiBFcHQ5oC+OTlhSWK 4ZHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725443657; x=1726048457; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZgLa9SdUIAi6e7ik6JqpM2eYBsOTolxt6NO9uP1zYZo=; b=E0dLGN5tjjU3kSEWft8phr/wIFKOnFGh2UDuZGyfVCwvxtBvCy7OYvWWcFKSFnIe3w n/ocNauJ58dthxWVHtp5+9Zhw7+j0oRgRYVn6a4oqUv2Hk4KwovH5Z2wRmsDxZIWTBTU lCP1viMvOibr4zsA9Cy5C9AyiO0c1NPOJTpCTNtd4KrKoG+XUZw7wp0WIHPOkemH0FKQ nObTnL7+p8sn+F65VYi7nLdJlJUcC0hFqTetvMXZBPSFIemxzcQK5Yvom58P210yRmj/ ZugceK6+p94nZORNpXxZAsnFJ9z4BE9Faa3Ox5xf9tR11dAsDpTjwwJUZSkvCf8flH9D 8MUA== X-Forwarded-Encrypted: i=1; AJvYcCVo7kx/FJCnkPsoJTCWuEBxXU3e8F64j07J2lG0NDIpZDGW4WemexyftqF+rqUfzWcEf0roO79A9/+YlQ==@gcc.gnu.org X-Gm-Message-State: AOJu0Yx8R8dLtmp9sVt2l7v0tvKyipL7f3DoYQhht+2VemaVky1w618C gkTzmYuSbJJf9cG6+fRdIkVxrACPEJkyFhMaLL2gV9B06X+Q1hL7/NYKhA8U+08xVzjnlCOaM6C p X-Google-Smtp-Source: AGHT+IFQRNRRNNAstJyGYYiCMCbcswW08QS6dJmksr+OCvBbJ8/9kFqsQcaP5gs7z3HR8ceHDGIy6Q== X-Received: by 2002:a5d:648d:0:b0:374:c6ad:a7c6 with SMTP id ffacd0b85a97d-374c6adab4amr7320185f8f.20.1725443656548; Wed, 04 Sep 2024 02:54:16 -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 5b1f17b1804b1-42c89dca8absm53354995e9.27.2024.09.04.02.54.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2024 02:54:16 -0700 (PDT) From: Thomas Schwinge To: Prathamesh Kulkarni , gcc-patches@gcc.gnu.org Subject: Add 'gcc.target/nvptx/alias-to-alias-1.c' (was: [nvptx] Fix code-gen for alias attribute) In-Reply-To: <877cbrzr9r.fsf@euler.schwinge.ddns.net> References: <877cbrzr9r.fsf@euler.schwinge.ddns.net> User-Agent: Notmuch/0.30+8~g47a4bad (https://notmuchmail.org) Emacs/29.4 (x86_64-pc-linux-gnu) Date: Wed, 04 Sep 2024 11:54:09 +0200 Message-ID: <871q1zzqv2.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 2024-09-04T11:45:20+0200, I wrote: > On 2024-08-26T10:50:36+0000, Prathamesh Kulkarni wrote: >> For the following test (adapted from pr96390.c): >> >> __attribute__((noipa)) int foo () { return 42; } >> int bar () __attribute__((alias ("foo"))); >> int baz () __attribute__((alias ("bar"))); > >> Compiling [for nvptx] results in: [...] > proposed patch [...] (doesn't affect > '--target=nvptx-none' test results at all...) Pushed to trunk branch commit a89321c890b96c583671b73fc802e87545e4a2b1 "Add 'gcc.target/nvptx/alias-to-alias-1.c'", see attached, which as part of your proposed patch you'll then need to update as follows (or similar): --- gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c +++ gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c @@ -1,6 +1,8 @@ /* Alias to alias; 'libgomp.c-c++-common/pr96390.c'. */ -/* { dg-do compile } */ +/* { dg-do link } */ +/* { dg-do run { target runtime_ptx_alias } } */ +/* { dg-options -save-temps } */ /* { dg-add-options ptx_alias } */ int v; @@ -23,5 +25,6 @@ main (void) /* { dg-final { scan-assembler-times "\\.visible \\.func foo;" 1 } } */ /* { dg-final { scan-assembler-times "\\.visible \\.func bar;" 1 } } */ -/* { dg-final { scan-assembler-times "\\.alias baz,bar;" 1 } } */ +/* Via 'ultimate_alias_target': + { dg-final { scan-assembler-times "\\.alias baz,foo;" 1 } } */ /* { dg-final { scan-assembler-times "\\.visible \\.func baz;" 1 } } */ Grüße Thomas From a89321c890b96c583671b73fc802e87545e4a2b1 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 4 Sep 2024 09:44:33 +0200 Subject: [PATCH] Add 'gcc.target/nvptx/alias-to-alias-1.c' ... similar to alias to alias usage in 'libgomp.c-c++-common/pr96390.c'. PR target/104957 gcc/testsuite/ * gcc.target/nvptx/alias-to-alias-1.c: New. --- .../gcc.target/nvptx/alias-to-alias-1.c | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c diff --git a/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c b/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c new file mode 100644 index 00000000000..3db79d1fc0b --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/alias-to-alias-1.c @@ -0,0 +1,27 @@ +/* Alias to alias; 'libgomp.c-c++-common/pr96390.c'. */ + +/* { dg-do compile } */ +/* { dg-add-options ptx_alias } */ + +int v; + +void foo () { v = 42; } +void bar () __attribute__((alias ("foo"))); +void baz () __attribute__((alias ("bar"))); + +int +main (void) +{ + baz (); + if (v != 42) + __builtin_abort (); + + return 0; +} + +/* { dg-final { scan-assembler-times "\\.alias bar,foo;" 1 } } */ +/* { dg-final { scan-assembler-times "\\.visible \\.func foo;" 1 } } */ +/* { dg-final { scan-assembler-times "\\.visible \\.func bar;" 1 } } */ + +/* { dg-final { scan-assembler-times "\\.alias baz,bar;" 1 } } */ +/* { dg-final { scan-assembler-times "\\.visible \\.func baz;" 1 } } */ -- 2.34.1