From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id DDB7238515E3; Thu, 25 Mar 2021 10:53:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DDB7238515E3 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Thomas_Schwinge@mentor.com IronPort-SDR: dL38J5br/ZjpBkKUiHK6aR1ZXDFFXgBfxTzdMNlztY/oYgk6nUd1flM/8dgjcfeTnPONPcPwTI S+dEJZ3oAfELjEQMJjVxzpz0Cfg4ueESVNIq+vFfmpWicK/v0kG1hMV+FXQ7PUlDu/HHknoqq8 vi6EqbjAOgJPK8fGFd83lx4HtGYwMTMpeCHGOR6gDiZ4ZmyB1cqiP8xHMFHAFPFz1QCZ0WAWWm HwfmJl+GilIGgemlOiCVq2sdqfF7AUJyyTUesJsaec/4oiMi4Bjyf+1rr+NmaodCVPOouFbo0b EqI= X-IronPort-AV: E=Sophos;i="5.81,277,1610438400"; d="scan'208,223";a="59599919" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 25 Mar 2021 02:53:26 -0800 IronPort-SDR: RBiO6anQtJqm1+G2R8I2UkrbuO3Vyr9emXykHmBShyAHm8gLdSBK07GsnXdKbcvmsnNaoXIns/ XOV3wYR8HfPT60XH7Bdfp0NBMI4kw7cVy2IoRUk47sX+DoCS7tfXW7JLhH2RInJ4mW8JDqqILw qpmawl3nBprLPnDiBFPVlI5XByn7tqOQLFKW/sces7xF280LrEkhHGWpr2y54/YmAjF27/aBQw ulrpR5OtV5rwCPhEEMVhpluykY4tfQbNcOGnrhUfQJLXYsSih2Wwe8T5xfgbZsmi3bNpU7NSy2 sxc= From: Thomas Schwinge To: Tobias Burnus , CC: Jakub Jelinek , Subject: Re: [Patch] OpenMP: Handle order(concurrent) clause in gfortran In-Reply-To: <513a35fb-2332-13e8-88b9-c1f89eabfe44@codesourcery.com> References: <513a35fb-2332-13e8-88b9-c1f89eabfe44@codesourcery.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/27.1 (x86_64-pc-linux-gnu) Date: Thu, 25 Mar 2021 11:53:17 +0100 Message-ID: <87ft0jzeqq.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-05.mgc.mentorg.com (139.181.222.5) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LOTSOFHASH, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Thu, 25 Mar 2021 10:53:30 -0000 --=-=-= Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi! On 2020-07-29T18:30:16+0200, Tobias Burnus wrote: > Adds 'order(concurrent)'. OpenMP 5.0 also permits it > for 'loop' but gfortran does not yet support 'loop'. > > (That the argument is passed on to the ME can be > seen by the testcases as the errors are emitted > by the ME.) This later got cherry-picked into devel/omp/gcc-10 branch, with FAILing testcase 'gfortran.dg/gomp/order-4.f90'. I've now pushed "Adjust 'gfortran.dg/gomp/order-4.f90' for og10" to devel/omp/gcc-10 branch in commit b0e5c3b84ef2c477fe797da59a1aadfbed8445fe, see attached. Gr=C3=BC=C3=9Fe Thomas > OpenMP: Handle order(concurrent) clause in gfortran > > gcc/fortran/ChangeLog: > > * dump-parse-tree.c (show_omp_clauses): Handle order(concurrent). > * gfortran.h (struct gfc_omp_clauses): Add order_concurrent. > * openmp.c (enum omp_mask1, OMP_DO_CLAUSES, OMP_SIMD_CLAUSES): > Add OMP_CLAUSE_ORDER. > * trans-openmp.c (gfc_trans_omp_clauses, gfc_split_omp_clauses): > Handle order(concurrent) clause. > > gcc/testsuite/ChangeLog: > > * gfortran.dg/gomp/order-3.f90: New test. > * gfortran.dg/gomp/order-4.f90: New test. > > gcc/fortran/dump-parse-tree.c | 2 + > gcc/fortran/gfortran.h | 2 +- > gcc/fortran/openmp.c | 12 +- > gcc/fortran/trans-openmp.c | 12 ++ > gcc/testsuite/gfortran.dg/gomp/order-3.f90 | 227 +++++++++++++++++++++++= ++++++ > gcc/testsuite/gfortran.dg/gomp/order-4.f90 | 34 +++++ > 6 files changed, 286 insertions(+), 3 deletions(-) > > diff --git a/gcc/fortran/dump-parse-tree.c b/gcc/fortran/dump-parse-tree.= c > index 2a02bc871bc..71d0e7d00f5 100644 > --- a/gcc/fortran/dump-parse-tree.c > +++ b/gcc/fortran/dump-parse-tree.c > @@ -1552,6 +1552,8 @@ show_omp_clauses (gfc_omp_clauses *omp_clauses) > fputs (" SEQ", dumpfile); > if (omp_clauses->independent) > fputs (" INDEPENDENT", dumpfile); > + if (omp_clauses->order_concurrent) > + fputs (" ORDER(CONCURRENT)", dumpfile); > if (omp_clauses->ordered) > { > if (omp_clauses->orderedc) > diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h > index 20cce5cf39b..48b2ab14fdb 100644 > --- a/gcc/fortran/gfortran.h > +++ b/gcc/fortran/gfortran.h > @@ -1365,7 +1365,7 @@ typedef struct gfc_omp_clauses > bool nowait, ordered, untied, mergeable; > bool inbranch, notinbranch, defaultmap, nogroup; > bool sched_simd, sched_monotonic, sched_nonmonotonic; > - bool simd, threads, depend_source; > + bool simd, threads, depend_source, order_concurrent; > enum gfc_omp_cancel_kind cancel; > enum gfc_omp_proc_bind_kind proc_bind; > struct gfc_expr *safelen_expr; > diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c > index 16f39a4e086..ec116206a5c 100644 > --- a/gcc/fortran/openmp.c > +++ b/gcc/fortran/openmp.c > @@ -766,6 +766,7 @@ enum omp_mask1 > OMP_CLAUSE_NUM_THREADS, > OMP_CLAUSE_SCHEDULE, > OMP_CLAUSE_DEFAULT, > + OMP_CLAUSE_ORDER, > OMP_CLAUSE_ORDERED, > OMP_CLAUSE_COLLAPSE, > OMP_CLAUSE_UNTIED, > @@ -1549,6 +1550,13 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, const= omp_mask mask, > continue; > break; > case 'o': > + if ((mask & OMP_CLAUSE_ORDER) > + && !c->order_concurrent > + && gfc_match ("order ( concurrent )") =3D=3D MATCH_YES) > + { > + c->order_concurrent =3D true; > + continue; > + } > if ((mask & OMP_CLAUSE_ORDERED) > && !c->ordered > && gfc_match ("ordered") =3D=3D MATCH_YES) > @@ -2575,7 +2583,7 @@ cleanup: > (omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_FIRSTPRIVATE \ > | OMP_CLAUSE_LASTPRIVATE | OMP_CLAUSE_REDUCTION \ > | OMP_CLAUSE_SCHEDULE | OMP_CLAUSE_ORDERED | OMP_CLAUSE_COLLAPSE \ > - | OMP_CLAUSE_LINEAR) > + | OMP_CLAUSE_LINEAR | OMP_CLAUSE_ORDER) > #define OMP_SECTIONS_CLAUSES \ > (omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_FIRSTPRIVATE \ > | OMP_CLAUSE_LASTPRIVATE | OMP_CLAUSE_REDUCTION) > @@ -2583,7 +2591,7 @@ cleanup: > (omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_LASTPRIVATE \ > | OMP_CLAUSE_REDUCTION | OMP_CLAUSE_COLLAPSE | OMP_CLAUSE_SAFELEN \ > | OMP_CLAUSE_LINEAR | OMP_CLAUSE_ALIGNED | OMP_CLAUSE_SIMDLEN \ > - | OMP_CLAUSE_IF) > + | OMP_CLAUSE_IF | OMP_CLAUSE_ORDER) > #define OMP_TASK_CLAUSES \ > (omp_mask (OMP_CLAUSE_PRIVATE) | OMP_CLAUSE_FIRSTPRIVATE \ > | OMP_CLAUSE_SHARED | OMP_CLAUSE_IF | OMP_CLAUSE_DEFAULT \ > diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c > index f6a39edf121..076efb03831 100644 > --- a/gcc/fortran/trans-openmp.c > +++ b/gcc/fortran/trans-openmp.c > @@ -3371,6 +3371,12 @@ gfc_trans_omp_clauses (stmtblock_t *block, gfc_omp= _clauses *clauses, > omp_clauses =3D gfc_trans_add_clause (c, omp_clauses); > } > > + if (clauses->order_concurrent) > + { > + c =3D build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_ORDE= R); > + omp_clauses =3D gfc_trans_add_clause (c, omp_clauses); > + } > + > if (clauses->untied) > { > c =3D build_omp_clause (gfc_get_location (&where), OMP_CLAUSE_UNTI= ED); > @@ -4970,6 +4976,8 @@ gfc_split_omp_clauses (gfc_code *code, > /* Duplicate collapse. */ > clausesa[GFC_OMP_SPLIT_DISTRIBUTE].collapse > =3D code->ext.omp_clauses->collapse; > + clausesa[GFC_OMP_SPLIT_DISTRIBUTE].order_concurrent > + =3D code->ext.omp_clauses->order_concurrent; > } > if (mask & GFC_OMP_MASK_PARALLEL) > { > @@ -5015,6 +5023,8 @@ gfc_split_omp_clauses (gfc_code *code, > /* Duplicate collapse. */ > clausesa[GFC_OMP_SPLIT_DO].collapse > =3D code->ext.omp_clauses->collapse; > + clausesa[GFC_OMP_SPLIT_DO].order_concurrent > + =3D code->ext.omp_clauses->order_concurrent; > } > if (mask & GFC_OMP_MASK_SIMD) > { > @@ -5029,6 +5039,8 @@ gfc_split_omp_clauses (gfc_code *code, > =3D code->ext.omp_clauses->collapse; > clausesa[GFC_OMP_SPLIT_SIMD].if_exprs[OMP_IF_SIMD] > =3D code->ext.omp_clauses->if_exprs[OMP_IF_SIMD]; > + clausesa[GFC_OMP_SPLIT_SIMD].order_concurrent > + =3D code->ext.omp_clauses->order_concurrent; > /* And this is copied to all. */ > clausesa[GFC_OMP_SPLIT_SIMD].if_expr > =3D code->ext.omp_clauses->if_expr; > diff --git a/gcc/testsuite/gfortran.dg/gomp/order-3.f90 b/gcc/testsuite/g= fortran.dg/gomp/order-3.f90 > new file mode 100644 > index 00000000000..06df89fc392 > --- /dev/null > +++ b/gcc/testsuite/gfortran.dg/gomp/order-3.f90 > @@ -0,0 +1,227 @@ > +module my_omp_mod > + use iso_c_binding, only: c_loc > + implicit none > + integer :: v > + interface > + integer function omp_get_thread_num () bind(C) > + end > + integer function omp_get_num_threads () bind(C) > + end > + integer function omp_get_cancellation () bind(C) > + end > + integer function omp_target_is_present (ptr, device_num) bind(C) > + use iso_c_binding, only: c_ptr > + type(c_ptr), value :: ptr > + integer :: device_num > + end > + end interface > +contains > + subroutine foo () > + end > +end > + > +subroutine f1 (a, b) > + use my_omp_mod > + implicit none > + integer :: a(:), b(:,:) > + target :: a > + integer i, j > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + !$omp parallel ! { dg-error "OpenMP constructs other than = 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' = region" } > + call foo () > + !$omp end parallel > + end do > + !$omp end simd > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + !$omp simd > + do j =3D 1, 64 > + b(j, i) =3D i + j > + end do > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + !$omp critical ! { dg-error "OpenMP constructs other than = 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' = region" } > + call foo () > + !$omp end critical > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + !$omp ordered simd ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + call foo () > + !$omp end ordered > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + !$omp atomic ! { dg-error "OpenMP constructs other than = 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'or= der\\(concurrent\\)' clause" } > + v =3D v + 1 > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + !$omp atomic read ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + a(i) =3D v > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + !$omp atomic write ! { dg-error "OpenMP constructs other than = 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'or= der\\(concurrent\\)' clause" } > + v =3D a(i) > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime = API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(c= oncurrent\\)' clause" } > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime= API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\= (concurrent\\)' clause" } > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_target_is_present (c_loc(a(i)), 0) ! { dg-error= "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a re= gion with 'order\\(concurrent\\)' clause" } > + end do > + !$omp simd order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtim= e API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order= \\(concurrent\\)' clause" } > + end do > +end > + > +subroutine f2 (a, b) > + use my_omp_mod > + implicit none > + integer a(:), b(:,:) > + target :: a > + integer i, j > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + !$omp parallel ! { dg-error "OpenMP constructs other than = 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' = region" } > + call foo () > + !$omp end parallel > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + !$omp simd > + do j =3D 1, 64 > + b (j, i) =3D i + j > + end do > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + !$omp critical ! { dg-error "OpenMP constructs other than = 'ordered simd', 'simd', 'loop' or 'atomic' may not be nested inside 'simd' = region" } > + call foo () > + !$omp end critical > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + !$omp ordered simd ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + call foo () > + !$omp end ordered > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + !$omp atomic ! { dg-error "OpenMP constructs other than = 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'or= der\\(concurrent\\)' clause" } > + v =3D v + 1 > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + !$omp atomic read ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + a(i) =3D v > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + !$omp atomic write ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + v =3D a(i) > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime = API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(c= oncurrent\\)' clause" } > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime= API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\= (concurrent\\)' clause" } > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_target_is_present (c_loc(a(i)), 0) ! { dg-error= "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a re= gion with 'order\\(concurrent\\)' clause" } > + end do > + !$omp do simd order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtim= e API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order= \\(concurrent\\)' clause" } > + end do > +end > + > +subroutine f3 (a, b) > + use my_omp_mod > + implicit none > + integer :: a(:), b(:,:) > + target :: a > + integer i, j > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp parallel > + call foo () > + !$omp end parallel > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp simd > + do j =3D 1, 64 > + b(j, i) =3D i + j > + end do > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp critical ! { dg-error "OpenMP constructs other than = 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'or= der\\(concurrent\\)' clause" } > + call foo () > + !$omp end critical > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp ordered simd ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + call foo () > + !$omp end ordered > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp atomic ! { dg-error "OpenMP constructs other than = 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'or= der\\(concurrent\\)' clause" } > + v =3D v + 1 > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp atomic read ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + a(i) =3D v > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp atomic write ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + v =3D a(i) > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp task ! { dg-error "OpenMP constructs oth= er than 'parallel', 'loop' or 'simd' may not be nested inside a region with= the 'order\\(concurrent\\)' clause" } > + a(i) =3D a(i) + 1 > + !$omp end task > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + !$omp taskloop ! { dg-error "OpenMP constructs other than = 'parallel', 'loop' or 'simd' may not be nested inside a region with the 'or= der\\(concurrent\\)' clause" } > + do j =3D 1, 64 > + b(j, i) =3D i + j > + end do > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_thread_num () ! { dg-error "OpenMP runtime = API call '\[^\n\r]*omp_get_thread_num\[^\n\r]*' in a region with 'order\\(c= oncurrent\\)' clause" } > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_num_threads () ! { dg-error "OpenMP runtime= API call '\[^\n\r]*omp_get_num_threads\[^\n\r]*' in a region with 'order\\= (concurrent\\)' clause" } > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_target_is_present (c_loc(a(i)), 0) ! { dg-error= "OpenMP runtime API call '\[^\n\r]*omp_target_is_present\[^\n\r]*' in a re= gion with 'order\\(concurrent\\)' clause" } > + end do > + !$omp do order(concurrent) > + do i =3D 1, 64 > + a(i) =3D a(i) + omp_get_cancellation () ! { dg-error "OpenMP runtim= e API call '\[^\n\r]*omp_get_cancellation\[^\n\r]*' in a region with 'order= \\(concurrent\\)' clause" } > + end do > +end > diff --git a/gcc/testsuite/gfortran.dg/gomp/order-4.f90 b/gcc/testsuite/g= fortran.dg/gomp/order-4.f90 > new file mode 100644 > index 00000000000..e4580e38b89 > --- /dev/null > +++ b/gcc/testsuite/gfortran.dg/gomp/order-4.f90 > @@ -0,0 +1,34 @@ > +module m > + integer t; > + !$omp threadprivate(t) > +end > + > +subroutine f1 > + use m > + implicit none > + integer :: i > + !$omp simd order(concurrent) ! { dg-message "note: enclosing region" = } */ > + do i =3D 1, 64 > + t =3D t + 1 ! { dg-error "threadprivate variable 't' used in a regi= on with 'order\\(concurrent\\)' clause" } */ > + end do > +end > + > +subroutine f2 > + use m > + implicit none > + integer :: i > + !$omp do simd order(concurrent) ! { dg-message "note: enclosing region= " } */ > + do i =3D 1, 64 > + t =3D t + 1 ! { dg-error "threadprivate variable 't' used in a regi= on with 'order\\(concurrent\\)' clause" } */ > + end do > +end > + > +subroutine f3 > + use m > + implicit none > + integer :: i > + !$omp do order(concurrent) ! { dg-message "note: enclosing region" } = */ > + do i =3D 1, 64 > + t =3D t + 1 ! { dg-error "threadprivate variable 't' used in a regi= on with 'order\\(concurrent\\)' clause" } */ > + end do > +end ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 M=C3=BCnchen R= egistergericht M=C3=BCnchen HRB 106955, Gesch=C3=A4ftsf=C3=BChrer: Thomas H= eurung, Frank Th=C3=BCrauf --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename="0001-Adjust-gfortran.dg-gomp-order-4.f90-for-og10.og10.patch" >From b0e5c3b84ef2c477fe797da59a1aadfbed8445fe Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 16 Oct 2020 11:20:21 +0200 Subject: [PATCH] Adjust 'gfortran.dg/gomp/order-4.f90' for og10 Testcase added in og10 commit 835160b024ce34bc6f258e7df366bb5c15e12a4b "OpenMP: Handle order(concurrent) clause in gfortran" (cherry picked from commit d8140b9ed3c0fed041aedaff3fa4a603984ca10f), but og10 doesn't have commit 4f2ab6b89e170f1343f935761481c3745fe603b1 "[OpenMP, gimplifier] 'inform' after 'error' diagnostic". gcc/testsuite/ * gfortran.dg/gomp/order-4.f90: Adjust. --- gcc/testsuite/ChangeLog.omp | 4 ++++ gcc/testsuite/gfortran.dg/gomp/order-4.f90 | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp index d010ff87307c..97cad18a0692 100644 --- a/gcc/testsuite/ChangeLog.omp +++ b/gcc/testsuite/ChangeLog.omp @@ -1,3 +1,7 @@ +2021-03-25 Thomas Schwinge + + * gfortran.dg/gomp/order-4.f90: Adjust. + 2021-02-25 Tobias Burnus Backport from mainline diff --git a/gcc/testsuite/gfortran.dg/gomp/order-4.f90 b/gcc/testsuite/gfortran.dg/gomp/order-4.f90 index e4580e38b89a..e3863b6805bf 100644 --- a/gcc/testsuite/gfortran.dg/gomp/order-4.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/order-4.f90 @@ -7,7 +7,7 @@ subroutine f1 use m implicit none integer :: i - !$omp simd order(concurrent) ! { dg-message "note: enclosing region" } */ + !$omp simd order(concurrent) ! { dg-error "enclosing region" } do i = 1, 64 t = t + 1 ! { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */ end do @@ -17,9 +17,10 @@ subroutine f2 use m implicit none integer :: i - !$omp do simd order(concurrent) ! { dg-message "note: enclosing region" } */ + !$omp do simd order(concurrent) ! { dg-error "enclosing region" } do i = 1, 64 t = t + 1 ! { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */ + ! { dg-error "enclosing region" "" { target *-*-* } .-1 } end do end @@ -27,7 +28,7 @@ subroutine f3 use m implicit none integer :: i - !$omp do order(concurrent) ! { dg-message "note: enclosing region" } */ + !$omp do order(concurrent) ! { dg-error "enclosing region" } do i = 1, 64 t = t + 1 ! { dg-error "threadprivate variable 't' used in a region with 'order\\(concurrent\\)' clause" } */ end do -- 2.30.2 --=-=-=--