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 ESMTP id 613CE3858419 for ; Thu, 14 Oct 2021 12:47:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 613CE3858419 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-546-vy45EJgKMY2HvaiKH3CTNw-1; Thu, 14 Oct 2021 08:47:06 -0400 X-MC-Unique: vy45EJgKMY2HvaiKH3CTNw-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 C53B61018720; Thu, 14 Oct 2021 12:47:05 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.172]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 09B00B854B; Thu, 14 Oct 2021 12:47:04 +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 19ECl2sA2771719 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 14 Oct 2021 14:47:02 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 19ECl1JJ2771718; Thu, 14 Oct 2021 14:47:01 +0200 Date: Thu, 14 Oct 2021 14:47:01 +0200 From: Jakub Jelinek To: Kwok Cheung Yeung Cc: gcc-patches , fortran , Tobias Burnus Subject: Re: [PATCH] openmp, fortran: Add support for declare variant in Fortran Message-ID: <20211014124701.GZ304296@tucnak> Reply-To: Jakub Jelinek References: <8296c73e-2a16-0232-d1ac-49c5c7330481@codesourcery.com> <20211006153635.GJ304296@tucnak> 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=-3.7 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_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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: Thu, 14 Oct 2021 12:47:09 -0000 On Thu, Oct 14, 2021 at 11:04:59AM +0100, Kwok Cheung Yeung wrote: > I have now dropped this. This affects test2 in > gfortran.dg/gomp/declare-variant-8.f90, which I have added a comment to. Thanks. > I have added Fortran-specific tests as > gfortran.dg/gomp/declare-variant-15.f90 to declare-variant-19.f90. What I still miss is tests for the (proc_name : variant_name) syntax in places where proc_name : is optional, but is supplied and is valid, like e.g. in interface, or in subroutine/function and where proc_name specifies the name of the containing interface or subroutine/function. I see that syntax tested in some places with dg-error on that line and in spaces where it isn't optional (e.g. at module scope before contains). But if you want, that can be added incrementally. > From ab03cf08c6ee4a0a6323189313cae911483a2257 Mon Sep 17 00:00:00 2001 > From: Kwok Cheung Yeung > Date: Wed, 13 Oct 2021 22:39:20 +0100 > Subject: [PATCH] openmp, fortran: Add support for OpenMP declare variant > directive in Fortran > > 2021-10-13 Kwok Cheung Yeung > > gcc/c-family/ > > * c-omp.c (c_omp_check_context_selector): Rename to > omp_check_context_selector and move to omp-general.c. > (c_omp_mark_declare_variant): Rename to omp_mark_declare_variant and > move to omp-general.c. > > gcc/c/ > > * c-parser.c (c_finish_omp_declare_variant): Change call from > c_omp_check_context_selector to omp_check_context_selector. Change > call from c_omp_mark_declare_variant to omp_mark_declare_variant. > > gcc/cp/ > > * decl.c (omp_declare_variant_finalize_one): Change call from > c_omp_mark_declare_variant to omp_mark_declare_variant. > * parser.c (cp_finish_omp_declare_variant): Change call from > c_omp_check_context_selector to omp_check_context_selector. > > gcc/fortran/ > > * gfortran.h (enum gfc_statement): Add ST_OMP_DECLARE_VARIANT. > (enum gfc_omp_trait_property_kind): New. > (struct gfc_omp_trait_property): New. > (gfc_get_omp_trait_property): New macro. > (struct gfc_omp_selector): New. > (gfc_get_omp_selector): New macro. > (struct gfc_omp_set_selector): New. > (gfc_get_omp_set_selector): New macro. > (struct gfc_omp_declare_variant): New. > (gfc_get_omp_declare_variant): New macro. > (struct gfc_namespace): Add omp_declare_variant field. > (gfc_free_omp_declare_variant_list): New prototype. > * match.h (gfc_match_omp_declare_variant): New prototype. > * openmp.c (gfc_free_omp_trait_property_list): New. > (gfc_free_omp_selector_list): New. > (gfc_free_omp_set_selector_list): New. > (gfc_free_omp_declare_variant_list): New. > (gfc_match_omp_clauses): Add extra optional argument. Handle end of > clauses for context selectors. > (omp_construct_selectors, omp_device_selectors, > omp_implementation_selectors, omp_user_selectors): New. > (gfc_match_omp_context_selector): New. > (gfc_match_omp_context_selector_specification): New. > (gfc_match_omp_declare_variant): New. > * parse.c: Include tree-core.h and omp-general.h. > (decode_omp_directive): Handle 'declare variant'. > (case_omp_decl): Include ST_OMP_DECLARE_VARIANT. > (gfc_ascii_statement): Handle ST_OMP_DECLARE_VARIANT. > (gfc_parse_file): Initialize omp_requires_mask. > * symbol.c (gfc_free_namespace): Call > gfc_free_omp_declare_variant_list. > * trans-decl.c (gfc_get_extern_function_decl): Call > gfc_trans_omp_declare_variant. > (gfc_create_function_decl): Call gfc_trans_omp_declare_variant. > * trans-openmp.c (gfc_trans_omp_declare_variant): New. > * trans-stmt.h (gfc_trans_omp_declare_variant): New prototype. > > gcc/ > > * omp-general.c (omp_check_context_selector): Move from c-omp.c. > (omp_mark_declare_variant): Move from c-omp.c. > (omp_context_name_list_prop): Update for Fortran strings. > * omp-general.h (omp_check_context_selector): New prototype. > (omp_mark_declare_variant): New prototype. > > gcc/testsuite/ > > * gfortran.dg/gomp/declare-variant-1.f90: New test. > * gfortran.dg/gomp/declare-variant-10.f90: New test. > * gfortran.dg/gomp/declare-variant-11.f90: New test. > * gfortran.dg/gomp/declare-variant-12.f90: New test. > * gfortran.dg/gomp/declare-variant-13.f90: New test. > * gfortran.dg/gomp/declare-variant-14.f90: New test. > * gfortran.dg/gomp/declare-variant-15.f90: New test. > * gfortran.dg/gomp/declare-variant-16.f90: New test. > * gfortran.dg/gomp/declare-variant-17.f90: New test. > * gfortran.dg/gomp/declare-variant-18.f90: New test. > * gfortran.dg/gomp/declare-variant-19.f90: New test. > * gfortran.dg/gomp/declare-variant-2.f90: New test. > * gfortran.dg/gomp/declare-variant-2a.f90: New test. > * gfortran.dg/gomp/declare-variant-3.f90: New test. > * gfortran.dg/gomp/declare-variant-4.f90: New test. > * gfortran.dg/gomp/declare-variant-5.f90: New test. > * gfortran.dg/gomp/declare-variant-6.f90: New test. > * gfortran.dg/gomp/declare-variant-7.f90: New test. > * gfortran.dg/gomp/declare-variant-8.f90: New test. > * gfortran.dg/gomp/declare-variant-9.f90: New test. > > libgomp/ > > * testsuite/libgomp.fortran/declare-variant-1.f90: New test. LGTM, thanks. Jakub