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.129.124]) by sourceware.org (Postfix) with ESMTPS id 0F327385842D for ; Mon, 28 Feb 2022 17:37:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0F327385842D 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-137-zBtX945oO2u62IShxGI6WA-1; Mon, 28 Feb 2022 12:37:52 -0500 X-MC-Unique: zBtX945oO2u62IShxGI6WA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABD28824FA7; Mon, 28 Feb 2022 17:37:50 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.99]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0E78D866EB; Mon, 28 Feb 2022 17:37: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 21SHbMQM2640181 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 28 Feb 2022 18:37:36 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 21SHbFW52640178; Mon, 28 Feb 2022 18:37:15 +0100 Date: Mon, 28 Feb 2022 18:37:15 +0100 From: Jakub Jelinek To: Mikael Morin Cc: Kwok Cheung Yeung , Tobias Burnus , gscfq@t-online.de, gcc-patches , fortran Subject: Re: [PATCH] openmp, fortran: Check that event handles passed to detach clauses are not arrays [PR104131] Message-ID: Reply-To: Jakub Jelinek References: <383792f1-a5c7-af10-c603-2f1332336648@codesourcery.com> <3c2d161f-481a-b223-a855-cadee01a5679@orange.fr> <8981ebb8-7b8e-19d7-a3b3-ef5fce239c53@orange.fr> MIME-Version: 1.0 In-Reply-To: <8981ebb8-7b8e-19d7-a3b3-ef5fce239c53@orange.fr> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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=-5.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Feb 2022 17:37:59 -0000 On Mon, Feb 28, 2022 at 06:33:15PM +0100, Mikael Morin wrote: > > It is true that the spots I saw in fortran/openmp.cc that test rank look > > like: > > if (!gfc_resolve_expr (el->expr) > > || el->expr->ts.type != BT_INTEGER || el->expr->rank != 0) > > etc., so probably !gfc_resolve_expr call is missing. > > > As long as the expression is expected to not be a (contained) function call, > I think it should work. > > In the general case non-syntaxic errors are preferably checked and reported > later at resolution stage, where contained functions are known. Oh, I've missed that it is done during parsing and not during resolution. That !gfc_resolve_expr call and the checking if it is BT_INTEGER etc. should be certainly moved to resolve_omp_clauses. Jakub