From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1534) id C4188399E05A; Fri, 4 Jun 2021 19:00:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C4188399E05A Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tobias Burnus To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/omp/gcc-11] OpenMP: Handle bind clause in tree-nested.c [PR100905] X-Act-Checkin: gcc X-Git-Author: Tobias Burnus X-Git-Refname: refs/heads/devel/omp/gcc-11 X-Git-Oldrev: cc8019a5cefec35d39a03facfa7359eaa16549a6 X-Git-Newrev: b838fc5450f50c3f0d41a7edb3a22cdc43728d9d Message-Id: <20210604190043.C4188399E05A@sourceware.org> Date: Fri, 4 Jun 2021 19:00:43 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2021 19:00:43 -0000 https://gcc.gnu.org/g:b838fc5450f50c3f0d41a7edb3a22cdc43728d9d commit b838fc5450f50c3f0d41a7edb3a22cdc43728d9d Author: Tobias Burnus Date: Fri Jun 4 20:56:48 2021 +0200 OpenMP: Handle bind clause in tree-nested.c [PR100905] PR middle-end/100905 gcc/ChangeLog: * tree-nested.c (convert_nonlocal_omp_clauses, convert_local_omp_clauses): Handle OMP_CLAUSE_BIND. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/loop-3.f90: New test. (cherry picked from commit c7070b31e12c18905ed0a60aaedd7a071aab5c60) Diff: --- gcc/ChangeLog.omp | 8 +++++ gcc/testsuite/ChangeLog.omp | 7 ++++ gcc/testsuite/gfortran.dg/gomp/loop-3.f90 | 55 +++++++++++++++++++++++++++++++ gcc/tree-nested.c | 2 ++ 4 files changed, 72 insertions(+) diff --git a/gcc/ChangeLog.omp b/gcc/ChangeLog.omp index df5f83dd488..25717436651 100644 --- a/gcc/ChangeLog.omp +++ b/gcc/ChangeLog.omp @@ -1,3 +1,11 @@ +2021-06-04 Tobias Burnus + + Backported from master: + 2021-06-04 Tobias Burnus + + * tree-nested.c (convert_nonlocal_omp_clauses, + convert_local_omp_clauses): Handle OMP_CLAUSE_BIND. + 2021-06-04 Tobias Burnus Backported from master: diff --git a/gcc/testsuite/ChangeLog.omp b/gcc/testsuite/ChangeLog.omp index 15e95667b79..4ed55d768af 100644 --- a/gcc/testsuite/ChangeLog.omp +++ b/gcc/testsuite/ChangeLog.omp @@ -1,3 +1,10 @@ +2021-06-04 Tobias Burnus + + Backported from master: + 2021-06-04 Tobias Burnus + + * gfortran.dg/gomp/loop-3.f90: New test. + 2021-06-04 Tobias Burnus Backported from master: diff --git a/gcc/testsuite/gfortran.dg/gomp/loop-3.f90 b/gcc/testsuite/gfortran.dg/gomp/loop-3.f90 new file mode 100644 index 00000000000..6d25b19735d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/loop-3.f90 @@ -0,0 +1,55 @@ +! PR middle-end/100905 +! +PROGRAM test_loop_order_concurrent + implicit none + integer :: a, cc(64), dd(64) + + dd = 54 + cc = 99 + + call test_loop() + call test_affinity(a) + if (a /= 5) stop 3 + call test_scan(cc, dd) + if (any (cc /= 99)) stop 4 + if (dd(1) /= 5 .or. dd(2) /= 104) stop 5 + +CONTAINS + + SUBROUTINE test_loop() + INTEGER,DIMENSION(1024):: a, b, c + INTEGER:: i + + DO i = 1, 1024 + a(i) = 1 + b(i) = i + 1 + c(i) = 2*(i + 1) + END DO + + !$omp loop order(concurrent) bind(thread) + DO i = 1, 1024 + a(i) = a(i) + b(i)*c(i) + END DO + + DO i = 1, 1024 + if (a(i) /= 1 + (b(i)*c(i))) stop 1 + END DO + END SUBROUTINE test_loop + + SUBROUTINE test_affinity(aa) + integer :: aa + !$omp task affinity(aa) + a = 5 + !$omp end task + end + + subroutine test_scan(c, d) + integer i, c(*), d(*) + !$omp simd reduction (inscan, +: a) + do i = 1, 64 + d(i) = a + !$omp scan exclusive (a) + a = a + c(i) + end do + end +END PROGRAM test_loop_order_concurrent diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index 1ce25f11dd4..0c30657b844 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -1484,6 +1484,7 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE_AUTO: case OMP_CLAUSE_IF_PRESENT: case OMP_CLAUSE_FINALIZE: + case OMP_CLAUSE_BIND: case OMP_CLAUSE__CONDTEMP_: case OMP_CLAUSE__SCANTEMP_: break; @@ -2266,6 +2267,7 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE_AUTO: case OMP_CLAUSE_IF_PRESENT: case OMP_CLAUSE_FINALIZE: + case OMP_CLAUSE_BIND: case OMP_CLAUSE__CONDTEMP_: case OMP_CLAUSE__SCANTEMP_: break;