From patchwork Tue Oct 24 19:25:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harald Anlauf X-Patchwork-Id: 1854605 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; secure) header.d=gmx.de header.i=anlauf@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=sHcDUE0U; 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 4SFMTX5qK0z23jn for ; Wed, 25 Oct 2023 06:25:19 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6D38F38582BE for ; Tue, 24 Oct 2023 19:25:16 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by sourceware.org (Postfix) with ESMTPS id C387C3858CDA; Tue, 24 Oct 2023 19:25:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C387C3858CDA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmx.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C387C3858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=212.227.17.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698175505; cv=none; b=XauFgf5KLDTL+y1EWirPqlPAXNArxfhu8+F6QNlEa+QTBhjWussCyWzPp7Tff761fIge+t4kNDkMh8jG+zUXbnFVkQTYZ3TLa6oq6OUP5zbCIeU7x7Oe8zJCXMfRi+M/1HakvyZos57/5dJ70yDSFBujY8koVJgOQxvXSyrQxC0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698175505; c=relaxed/simple; bh=7TPwM33xkihUl+EHrFj8aeAsDw26GPZ7gitx+Q6N59o=; h=DKIM-Signature:MIME-Version:Message-ID:From:To:Subject:Date; b=fhmwYPj3N7HgQW4dE7I7VUQtxow4yczbywR61ybZDuemzLtAv5MJoznFzFRkjQuRFtwo18pZAC0UoOhtGRX7y8P3xFvOasT47dpk3BbrUHHe+h0XSbunEBhpf4eX0QkrUb6FlXQBEpncpkRqoLX7Gj4RDylC+fP8aGItINselDw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1698175501; x=1698780301; i=anlauf@gmx.de; bh=7TPwM33xkihUl+EHrFj8aeAsDw26GPZ7gitx+Q6N59o=; h=X-UI-Sender-Class:From:To:Subject:Date; b=sHcDUE0UEdCTXM8dLOgo27q+13BLyKJSH+ASGaYfFIWtIEnNKeksICdfdxSLC7+w 4LD8DK6HKtxZca3lVWJpLo8zJU0hM+9gIMgweOMAVY2mOuCapVMCYPJSZsPfnFamC zHdgNign1YsLOlmMz4Z517JCuzrb+PsxOufgHx6VTf6NvUZEhjjeUPHO2H6eWE3yN LwB2Kv/k563Qtce7+UlZT79f1PPtmAD1kxirmr15XvtMaaBeuyD56NMLcRvrt6W7w hA6m6P0vl87JzhF49S0DUdDipnjdFPSdX4fXMRebaGF1V7mxdDMn/vUnUzAszJFrL jo01FKlB4vY086M+1Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [79.232.144.210] ([79.232.144.210]) by web-mail.gmx.net (3c-app-gmx-bap20.server.lan [172.19.172.90]) (via HTTP); Tue, 24 Oct 2023 21:25:01 +0200 MIME-Version: 1.0 Message-ID: From: Harald Anlauf To: fortran , gcc-patches Subject: [PATCH] Fortran/OpenMP: event handle in task detach cannot be a coarray [PR104131] Date: Tue, 24 Oct 2023 21:25:01 +0200 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:+9duKtOZVJOLIjYrnSbQAd5h0L/jq5KmMKyJGyWNueYZR1PZuWem7+ErYcX7bV2kelTxz FnEbMIpGb977LRssC0s7ZkQFT2B2YmPhFHZBxP4KVkVcRFWyQLmxbEF3ZTtummTE0ut1TOhLycdM h/AdTsZjWAUf/8MkvxjzwYX8h/lbUioCnqOZJrjtyGjKSF+ng+goP8EZTEGURPGKbhT4p46E84L2 +OW5V535ITbSJ0g40FfH2V7Bk/8mTCCoE0jlj2N4AuH7xiyffB4GB+nDNjXA40q4D9+XHAbajz9Z bI= UI-OutboundReport: notjunk:1;M01:P0:GkLM7NqdDJ8=;oPHQUTNIAujAIQbHPn4GTIk4OWe jBso33e4sOG+4waTRbeXBzeCRFV0vcc16AKhArHnsUAg6IbXbpGF2eU+IqWDhXZa7x19PMbQ8 7xCGR1yvrnn9bT+TWWLhNDsJFJ4CzjbccmrWBpmni7S9qj1PM3mxx8utZCUWys91kS3ud/jms cXGY0ZUb9W1WPMyWD11Vg4WNBJ2V9aeboz5TqLoswaf531XOsTSRjuRGdzOSTWiuLwQgmjkys 0CtXIfzA6WKWVzvyHAXB7qEmtHy+fvdW8J4ngxCsi7f2aBzSx5n0NvqQzLP5glm5JLUewVRh7 k4NOFBK/PNmSoVhGhrty5nmIUlNb7MA9QKlDTOy59t291L17Si1pS6wW707xv/wgB4OjRDVSk FrPXixfostnt195J4YNeDhEr47Mi63QZQ3BmEW2V1GHVNrUY/jMJ0pTGWFsOfsQZziyTmdn8s bXfbNkz6eKU1OM4fWKPWcNf0mcZXnluRt18CKpwP95+JJd6LytEeRwo5fJX5UWEqZUpD8LXro Czk/I1u0yDq43JP0W4s/6dhd5FS6rPw+tO/D7H+vbOtLQC2tkDgyhVySszQoDNRfzB3DPGoYQ 6TsvKiS8saYOM6YzXnwWDKLnGGgGEgeAjG0BNp5kCKDTQUwBUuaIR2K/dwbGAUxDjtqWAQ/Ee s77Vy9RRUYvdGX850X/Fdr/euulfH8wSnsXm4FRk18gsNmrFxqiiV/ed/GFM9q4QlXTt5fD4w TcUgKNvkUwO9WSE4taQQOSCw13xq6beuzVR5Nn2DDk0uWhvV1JAabqA5r7i6L2Q/0KcBG0Ljw 1It4alHdNjyopj0TFSiZj2+A== X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 Dear all, the attached simple patch adds a forgotten check that an event handle cannot be a coarray. This case appears to have been overlooked in the original fix for this PR. I intend to commit as obvious within 24h unless there are comments. Thanks, Harald From 2b5ed32cacfe84dc4df74b4dccf16ac830d9eb98 Mon Sep 17 00:00:00 2001 From: Harald Anlauf Date: Tue, 24 Oct 2023 21:18:02 +0200 Subject: [PATCH] Fortran/OpenMP: event handle in task detach cannot be a coarray [PR104131] gcc/fortran/ChangeLog: PR fortran/104131 * openmp.cc (resolve_omp_clauses): Add check that event handle is not a coarray. gcc/testsuite/ChangeLog: PR fortran/104131 * gfortran.dg/gomp/pr104131-2.f90: New test. --- gcc/fortran/openmp.cc | 3 +++ gcc/testsuite/gfortran.dg/gomp/pr104131-2.f90 | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr104131-2.f90 diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc index 1cc65d7fa49..08081dacde4 100644 --- a/gcc/fortran/openmp.cc +++ b/gcc/fortran/openmp.cc @@ -8967,6 +8967,9 @@ resolve_omp_clauses (gfc_code *code, gfc_omp_clauses *omp_clauses, else if (omp_clauses->detach->symtree->n.sym->attr.dimension > 0) gfc_error ("The event handle at %L must not be an array element", &omp_clauses->detach->where); + else if (omp_clauses->detach->symtree->n.sym->attr.codimension) + gfc_error ("The event handle at %L must not be a coarray", + &omp_clauses->detach->where); else if (omp_clauses->detach->symtree->n.sym->ts.type == BT_DERIVED || omp_clauses->detach->symtree->n.sym->ts.type == BT_CLASS) gfc_error ("The event handle at %L must not be part of " diff --git a/gcc/testsuite/gfortran.dg/gomp/pr104131-2.f90 b/gcc/testsuite/gfortran.dg/gomp/pr104131-2.f90 new file mode 100644 index 00000000000..3978a6ac31a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr104131-2.f90 @@ -0,0 +1,12 @@ +! { dg-do compile } +! { dg-options "-fopenmp -fcoarray=single" } +! PR fortran/104131 - event handle cannot be a coarray + +program p + use iso_c_binding, only: c_intptr_t + implicit none + integer, parameter :: omp_event_handle_kind = c_intptr_t + integer (kind=omp_event_handle_kind) :: x[*] +!$omp task detach (x) ! { dg-error "The event handle at \\\(1\\\) must not be a coarray" } +!$omp end task +end -- 2.35.3