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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 1F232385840F for ; Mon, 20 Sep 2021 15:14:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1F232385840F 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-501-XzN4drqqOsCNNrrt-7cPmQ-1; Mon, 20 Sep 2021 11:14:02 -0400 X-MC-Unique: XzN4drqqOsCNNrrt-7cPmQ-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 73A0F1800D41; Mon, 20 Sep 2021 15:14:01 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0FC6A5C1BB; Mon, 20 Sep 2021 15:14:00 +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 18KFDwVD3173054 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Mon, 20 Sep 2021 17:13:58 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 18KFDvRq3173053; Mon, 20 Sep 2021 17:13:57 +0200 Date: Mon, 20 Sep 2021 17:13:56 +0200 From: Jakub Jelinek To: Tobias Burnus Cc: gcc-patches , fortran Subject: Re: [Patch]GCC11 - Fortran: combined directives - order(concurrent) not on distribute (was: Re: [Patch] Fortran/OpenMP: unconstrained/reproducible ordered modifier) Message-ID: <20210920151356.GJ304296@tucnak> Reply-To: Jakub Jelinek References: <68b73c25-9e9d-ad04-88cf-03891ddc8ab9@codesourcery.com> <20210920095544.GI304296@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.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_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: Mon, 20 Sep 2021 15:14:05 -0000 On Mon, Sep 20, 2021 at 05:01:32PM +0200, Tobias Burnus wrote: > On 20.09.21 11:55, Jakub Jelinek via Fortran wrote: > > So the FE was splitting the order clause to distribute already before, > > perhaps we should undo that for gcc 11 which doesn't claim any OpenMP 5.1 > > support. > > The difference is e.g. the distribute parallel do order(concurrent) copyin(thr) > > case which used to be ok in 5.0 and is not in 5.1. > > Well, if I try with GCC 11: > > void f(int *a) > { > int i; > static int thr; > #pragma omp threadprivate (thr) > #pragma omp distribute parallel for order(concurrent) copyin(thr) > for (i = 0; i < 10; ++i) > { > thr = 5; > a[i] = thr; > } > } > > I get with gcc (+ gfortran): > error: threadprivate variable ‘thr’ used in a region with ‘order(concurrent)’ clause > I might have misunderstood the example. Sure, even before you couldn't use it in the region body, because order(concurrent) was split to worksharing-loop. The testcase that used to be accepted and is now rejected is e.g. int thr; #pragma omp threadprivate (thr) void foo (void) { int i; #pragma omp distribute parallel for order(concurrent) copyin(thr) for (i = 0; i < 10; ++i) ; } While copyin without actually using the threadprivate var in the body might look weird, in some cases it might be useful if the threadprivate variable is used in some following parallel region. > OK for GCC 11, only? > > Tobias > > ----------------- > 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 > GCC11 - Fortran: combined directives - order(concurrent) not on distribute > > While OpenMP 5.1 and GCC 12 permits 'order(concurrent)' on distribute, > OpenMP 5.0 and GCC 11 don't. This patch for GCC 11 ensures the clause also > does not end up on 'distribute' when splitting combined directives. > > gcc/fortran/ChangeLog: > > * trans-openmp.c (gfc_split_omp_clauses): Don't put 'order(concurrent)' > on 'distribute' for combined directives, matching OpenMP 5.0 > > gcc/testsuite/ChangeLog: > > * gfortran.dg/gomp/distribute-order-concurrent.f90: New test. Ok, thanks. Jakub