From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 7D7C63858C83 for ; Mon, 28 Feb 2022 14:07:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D7C63858C83 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-658-PLB6zmcUMiKFzUKzJr6yNg-1; Mon, 28 Feb 2022 09:07:51 -0500 X-MC-Unique: PLB6zmcUMiKFzUKzJr6yNg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5CDC48145FE; Mon, 28 Feb 2022 14:07:50 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BFD5C7C0F0; Mon, 28 Feb 2022 14:07:49 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 21SE7kI82637227 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 28 Feb 2022 15:07:47 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 21SE7jSx2637226; Mon, 28 Feb 2022 15:07:45 +0100 Date: Mon, 28 Feb 2022 15:07:45 +0100 From: Jakub Jelinek To: Kwok Cheung Yeung , Tobias Burnus Cc: gcc-patches , fortran , gscfq@t-online.de Subject: Re: [PATCH] openmp, fortran: Check that event handles passed to detach clauses are not arrays [PR104131] Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: , X-List-Received-Date: Mon, 28 Feb 2022 14:07:59 -0000 On Mon, Feb 28, 2022 at 02:01:03PM +0000, Kwok Cheung Yeung wrote: > gcc/fortran/ > > PR fortran/104131 > * openmp.cc (gfc_match_omp_detach): Check that the event handle is not > an array type. > > gcc/testsuite/ > > PR fortran/104131 > * gfortran.dg/gomp/pr104131.f90: New. > * gfortran.dg/gomp/pr104131-2.f90: New. > * gfortran.dg/gomp/task-detach-1.f90: Update expected error message. > --- > gcc/fortran/openmp.cc | 5 +++-- > gcc/testsuite/gfortran.dg/gomp/pr104131-2.f90 | 10 ++++++++++ > gcc/testsuite/gfortran.dg/gomp/pr104131.f90 | 10 ++++++++++ > gcc/testsuite/gfortran.dg/gomp/task-detach-1.f90 | 2 +- > 4 files changed, 24 insertions(+), 3 deletions(-) > create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr104131-2.f90 > create mode 100644 gcc/testsuite/gfortran.dg/gomp/pr104131.f90 > > diff --git a/gcc/fortran/openmp.cc b/gcc/fortran/openmp.cc > index 19142c4d8d0..50a1c476009 100644 > --- a/gcc/fortran/openmp.cc > +++ b/gcc/fortran/openmp.cc > @@ -531,9 +531,10 @@ gfc_match_omp_detach (gfc_expr **expr) > if (gfc_match_variable (expr, 0) != MATCH_YES) > goto syntax_error; > > - if ((*expr)->ts.type != BT_INTEGER || (*expr)->ts.kind != gfc_c_intptr_kind) > + if ((*expr)->ts.type != BT_INTEGER || (*expr)->ts.kind != gfc_c_intptr_kind > + || (*expr)->symtree->n.sym->as) Don't we usually test instead || (*expr)->rank != 0 when testing for scalars? Jakub