From patchwork Wed Mar 16 09:20:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 51994 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2BAE63844079 for ; Wed, 16 Mar 2022 09:21:05 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id AA7DA384402D; Wed, 16 Mar 2022 09:20:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA7DA384402D 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.90,186,1643702400"; d="scan'208,223";a="73043058" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 16 Mar 2022 01:20:46 -0800 IronPort-SDR: pLf4eg0inp5lkK8/9cwi8HMowhx/0LvzEh4nnE4UwCxggAWYcRxjH8UIW/Gn1a96CKq8pP+Xyo s+xluGjVpR03AFiJRF8ruOKC+1ifr4fBJWfgi4HxU1o0/Iv+rec3OxXlvMzLOTst9PFK54K0J0 sIz6JBdJyNyrcrlhA3oEowAoITyOX6lY6PL5UjmluFzc7TBsigP4fjPgT5PQr3qmlOfURjq+ih z7IFjBXhsbW/Qi2PVzUi0QiF61/1h31S4V1ECtBnOuB/2pmGANjP/xgRnUwpYNUW07FqgZYjVX edM= From: Thomas Schwinge To: Subject: OpenACC privatization diagnostics vs. 'assert' [PR102841] In-Reply-To: <87wnrryjg0.fsf@euler.schwinge.homeip.net> References: <87fszrv4pt.fsf@euler.schwinge.homeip.net> <20210419122356.386d25b1@squid.athome> <87wnrryjg0.fsf@euler.schwinge.homeip.net> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Wed, 16 Mar 2022 10:20:35 +0100 Message-ID: <87v8wel0d8.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: , Cc: Julian Brown , Jakub Jelinek , iains@gcc.gnu.org, ro@gcc.gnu.org Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi! On 2021-05-21T21:29:19+0200, I wrote: > I've pushed "[OpenACC privatization] Largely extend diagnostics and > corresponding testsuite coverage [PR90115]" to master branch in commit > 11b8286a83289f5b54e813f14ff56d730c3f3185 Pushed to master branch commit ab46fc7c3bf01337ea4554f08f4f6b0be8173557 "OpenACC privatization diagnostics vs. 'assert' [PR102841]", see attached. Grüße Thomas > --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-7.c > +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-7.c > @@ -1,6 +1,11 @@ > -/* { dg-do run } */ > - > /* Test if, if_present clauses on host_data construct. */ > + > +/* { dg-additional-options "-fopt-info-all-omp" } > + { dg-additional-options "--param=openacc-privatization=noisy" } > + { dg-additional-options "-foffload=-fopt-info-all-omp" } > + { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } > + for testing/documenting aspects of that functionality. */ > + > /* C/C++ variant of 'libgomp.oacc-fortran/host_data-5.F90' */ > > #include > @@ -14,15 +19,19 @@ foo (float *p, intptr_t host_p, int cond) > #pragma acc data copyin(host_p) > { > #pragma acc host_data use_device(p) if_present > + /* { dg-note {variable 'host_p\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */ > /* p not mapped yet, so it will be equal to the host pointer. */ > assert (p == (float *) host_p); > > #pragma acc data copy(p[0:100]) > + /* { dg-note {variable 'host_p\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */ > + /* { dg-note {variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 } */ > { > /* Not inside a host_data construct, so p is still the host pointer. */ > assert (p == (float *) host_p); > > #pragma acc host_data use_device(p) > + /* { dg-note {variable 'host_p\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */ > { > #if ACC_MEM_SHARED > assert (p == (float *) host_p); > @@ -33,6 +42,7 @@ foo (float *p, intptr_t host_p, int cond) > } > > #pragma acc host_data use_device(p) if_present > + /* { dg-note {variable 'host_p\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */ > { > #if ACC_MEM_SHARED > assert (p == (float *) host_p); > @@ -43,6 +53,8 @@ foo (float *p, intptr_t host_p, int cond) > } > > #pragma acc host_data use_device(p) if(cond) > + /* { dg-note {variable 'host_p\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */ > + /* { dg-note {variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target { ! openacc_host_selected } } .-2 } */ > { > #if ACC_MEM_SHARED > assert (p == (float *) host_p); ----------------- 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 From ab46fc7c3bf01337ea4554f08f4f6b0be8173557 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 16 Mar 2022 08:02:39 +0100 Subject: [PATCH] OpenACC privatization diagnostics vs. 'assert' [PR102841] It's an orthogonal concern why these diagnostics do appear at all for non-offloaded OpenACC constructs (where they're not relevant at all); PR90115. Depending on how 'assert' is implemented, it may cause temporaries to be created, and/or may lower into 'COND_EXPR's, and 'gcc/gimplify.cc:gimplify_cond_expr' uses 'create_tmp_var (type, "iftmp")'. Fix-up for commit 11b8286a83289f5b54e813f14ff56d730c3f3185 "[OpenACC privatization] Largely extend diagnostics and corresponding testsuite coverage [PR90115]". PR testsuite/102841 libgomp/ * testsuite/libgomp.oacc-c-c++-common/host_data-7.c: Adjust. --- libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-7.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-7.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-7.c index 66501e614fb..50b4fc264d0 100644 --- a/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-7.c +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/host_data-7.c @@ -4,7 +4,9 @@ { dg-additional-options "--param=openacc-privatization=noisy" } { dg-additional-options "-foffload=-fopt-info-all-omp" } { dg-additional-options "-foffload=--param=openacc-privatization=noisy" } - for testing/documenting aspects of that functionality. */ + Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types) or 'assert' implementation: + { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } + { dg-prune-output {note: variable 'iftmp\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } */ /* C/C++ variant of 'libgomp.oacc-fortran/host_data-5.F90' */ @@ -25,7 +27,6 @@ foo (float *p, intptr_t host_p, int cond) #pragma acc data copy(p[0:100]) /* { dg-note {variable 'host_p\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */ - /* { dg-note {variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-2 } */ { /* Not inside a host_data construct, so p is still the host pointer. */ assert (p == (float *) host_p); @@ -54,7 +55,6 @@ foo (float *p, intptr_t host_p, int cond) #pragma acc host_data use_device(p) if(cond) /* { dg-note {variable 'host_p\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } .-1 } */ - /* { dg-note {variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target { ! openacc_host_selected } } .-2 } */ { #if ACC_MEM_SHARED assert (p == (float *) host_p); -- 2.34.1