From 724d25f35387d4de3711bf51bd17671208ff3dbb Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 30 Mar 2017 22:31:40 +0200 Subject: [PATCH] re PR translation/80189 (gimplify.c: check whether parallel/task/teams should be translated) PR translation/80189 * gimplify.c (omp_default_clause): Use %qs instead of %s in diagnostic messages. testsuite/ * g++.dg/gomp/predetermined-1.C: Adjust expected diagnostics. * g++.dg/gomp/sharing-1.C: Likewise. * gfortran.dg/gomp/pr44536.f90: Likewise. * gfortran.dg/gomp/pr44036-1.f90: Likewise. * gfortran.dg/gomp/sharing-3.f90: Likewise. * gfortran.dg/gomp/crayptr3.f90: Likewise. * gfortran.dg/gomp/pr33439.f90: Likewise. * gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise. * gfortran.dg/gomp/sharing-1.f90: Likewise. * gfortran.dg/gomp/sharing-2.f90: Likewise. * gcc.dg/gomp/appendix-a/a.24.1.c: Likewise. * gcc.dg/gomp/sharing-1.c: Likewise. From-SVN: r246599 --- gcc/ChangeLog | 6 ++++++ gcc/gimplify.c | 4 ++-- gcc/testsuite/ChangeLog | 16 ++++++++++++++++ gcc/testsuite/g++.dg/gomp/predetermined-1.C | 6 +++--- gcc/testsuite/g++.dg/gomp/sharing-1.C | 2 +- gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c | 2 +- gcc/testsuite/gcc.dg/gomp/sharing-1.c | 2 +- .../gfortran.dg/gomp/appendix-a/a.24.1.f90 | 2 +- gcc/testsuite/gfortran.dg/gomp/crayptr3.f90 | 4 ++-- gcc/testsuite/gfortran.dg/gomp/pr33439.f90 | 10 +++++----- gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 | 4 ++-- gcc/testsuite/gfortran.dg/gomp/pr44536.f90 | 2 +- gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 | 2 +- gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 | 10 +++++----- gcc/testsuite/gfortran.dg/gomp/sharing-3.f90 | 2 +- 15 files changed, 48 insertions(+), 26 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d7fbf028456..18effd76ad6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-03-30 Jakub Jelinek + + PR translation/80189 + * gimplify.c (omp_default_clause): Use %qs instead of %s in + diagnostic messages. + 2017-03-30 Peter Bergner PR target/80246 diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 6deac4a987a..ff8d56b2154 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -6847,9 +6847,9 @@ omp_default_clause (struct gimplify_omp_ctx *ctx, tree decl, else gcc_unreachable (); - error ("%qE not specified in enclosing %s", + error ("%qE not specified in enclosing %qs", DECL_NAME (lang_hooks.decls.omp_report_decl (decl)), rtype); - error_at (ctx->location, "enclosing %s", rtype); + error_at (ctx->location, "enclosing %qs", rtype); } /* FALLTHRU */ case OMP_CLAUSE_DEFAULT_SHARED: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fcf4013338a..20a73bbb922 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,19 @@ +2017-03-30 Jakub Jelinek + + PR translation/80189 + * g++.dg/gomp/predetermined-1.C: Adjust expected diagnostics. + * g++.dg/gomp/sharing-1.C: Likewise. + * gfortran.dg/gomp/pr44536.f90: Likewise. + * gfortran.dg/gomp/pr44036-1.f90: Likewise. + * gfortran.dg/gomp/sharing-3.f90: Likewise. + * gfortran.dg/gomp/crayptr3.f90: Likewise. + * gfortran.dg/gomp/pr33439.f90: Likewise. + * gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise. + * gfortran.dg/gomp/sharing-1.f90: Likewise. + * gfortran.dg/gomp/sharing-2.f90: Likewise. + * gcc.dg/gomp/appendix-a/a.24.1.c: Likewise. + * gcc.dg/gomp/sharing-1.c: Likewise. + 2017-03-30 Peter Bergner PR target/80246 diff --git a/gcc/testsuite/g++.dg/gomp/predetermined-1.C b/gcc/testsuite/g++.dg/gomp/predetermined-1.C index dd09855de97..495c09e7dd8 100644 --- a/gcc/testsuite/g++.dg/gomp/predetermined-1.C +++ b/gcc/testsuite/g++.dg/gomp/predetermined-1.C @@ -19,15 +19,15 @@ const A foo (const A d, const C e) bar (&a); #pragma omp parallel default (none) bar (&b); - #pragma omp parallel default (none) // { dg-error "enclosing parallel" } + #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" } bar (&c); // { dg-error "not specified" } #pragma omp parallel default (none) bar (&d); - #pragma omp parallel default (none) // { dg-error "enclosing parallel" } + #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" } bar (&e); // { dg-error "not specified" } #pragma omp parallel default (none) bar (&f); - #pragma omp parallel default (none) // { dg-error "enclosing parallel" } + #pragma omp parallel default (none) // { dg-error "enclosing 'parallel'" } bar (&g); // { dg-error "not specified" } return f; } diff --git a/gcc/testsuite/g++.dg/gomp/sharing-1.C b/gcc/testsuite/g++.dg/gomp/sharing-1.C index 83b81809834..9dca5d9d656 100644 --- a/gcc/testsuite/g++.dg/gomp/sharing-1.C +++ b/gcc/testsuite/g++.dg/gomp/sharing-1.C @@ -52,7 +52,7 @@ main (void) *p = 7; s = 6; l = 0; -#pragma omp parallel for /* { dg-error "enclosing parallel" } */ \ +#pragma omp parallel for /* { dg-error "enclosing 'parallel'" } */ \ default (none) private (p) shared (s) for (i = 0; i < 64; i++) { diff --git a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c index 9d8baa37f23..3e820b7f98f 100644 --- a/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c +++ b/gcc/testsuite/gcc.dg/gomp/appendix-a/a.24.1.c @@ -20,7 +20,7 @@ a24 (int a) /* - c has const-qualified type */ z[i] = y; /* { dg-error "'i' not specified" "" { target *-*-* } 21 } */ - /* { dg-error "enclosing parallel" "" { target *-*-* } 13 } */ + /* { dg-error "enclosing 'parallel'" "" { target *-*-* } 13 } */ /* { dg-error "'y' not specified" "" { target *-*-* } 21 } */ #pragma omp for firstprivate(y) for (i = 0; i < 10; i++) diff --git a/gcc/testsuite/gcc.dg/gomp/sharing-1.c b/gcc/testsuite/gcc.dg/gomp/sharing-1.c index 90d389b7292..0e2b60fc0d5 100644 --- a/gcc/testsuite/gcc.dg/gomp/sharing-1.c +++ b/gcc/testsuite/gcc.dg/gomp/sharing-1.c @@ -35,7 +35,7 @@ main (void) *p = 7; s = 6; l = 0; -#pragma omp parallel for /* { dg-error "enclosing parallel" } */ \ +#pragma omp parallel for /* { dg-error "enclosing 'parallel'" } */ \ default (none) private (p) shared (s) for (i = 0; i < 64; i++) { diff --git a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 index e5b95450d28..e3629025a07 100644 --- a/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/appendix-a/a.24.1.f90 @@ -19,7 +19,7 @@ X=1 ! O.K. - X is THREADPRIVATE Z(I) = Y ! Error - cannot reference I or Y here ! { dg-error "'i' not specified" "" { target *-*-* } 20 } */ -! { dg-error "enclosing parallel" "" { target *-*-* } 14 } */ +! { dg-error "enclosing 'parallel'" "" { target *-*-* } 14 } */ ! { dg-error "'y' not specified" "" { target *-*-* } 20 } */ !$OMP DO firstprivate(y) DO I = 1,10 diff --git a/gcc/testsuite/gfortran.dg/gomp/crayptr3.f90 b/gcc/testsuite/gfortran.dg/gomp/crayptr3.f90 index be8f5a0f4a7..15bf864997f 100644 --- a/gcc/testsuite/gfortran.dg/gomp/crayptr3.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/crayptr3.f90 @@ -16,7 +16,7 @@ a = 1 !$omp end parallel -!$omp parallel default (none) ! { dg-error "enclosing parallel" } - a = 1 ! { dg-error "'ip' not specified in enclosing parallel" } +!$omp parallel default (none) ! { dg-error "enclosing 'parallel'" } + a = 1 ! { dg-error "'ip' not specified in enclosing 'parallel'" } !$omp end parallel end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr33439.f90 b/gcc/testsuite/gfortran.dg/gomp/pr33439.f90 index f7db7593d77..42fa22184b3 100644 --- a/gcc/testsuite/gfortran.dg/gomp/pr33439.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/pr33439.f90 @@ -5,9 +5,9 @@ subroutine pr33439_1 integer :: s, i s = 4 -!$omp parallel default(none) ! { dg-error "enclosing parallel" } +!$omp parallel default(none) ! { dg-error "enclosing 'parallel'" } call somethingelse -!$omp do schedule(static, s) ! { dg-error "not specified in enclosing parallel" } +!$omp do schedule(static, s) ! { dg-error "not specified in enclosing 'parallel'" } do i = 1, 8 call something end do @@ -18,8 +18,8 @@ end subroutine pr33439_1 subroutine pr33439_2 integer :: s, i s = 4 -!$omp parallel default(none) ! { dg-error "enclosing parallel" } -!$omp do schedule(static, s) ! { dg-error "not specified in enclosing parallel" } +!$omp parallel default(none) ! { dg-error "enclosing 'parallel'" } +!$omp do schedule(static, s) ! { dg-error "not specified in enclosing 'parallel'" } do i = 1, 8 call something end do @@ -30,7 +30,7 @@ end subroutine pr33439_2 subroutine pr33439_3 integer :: s, i s = 4 -!$omp parallel do default(none) schedule(static, s) ! { dg-error "enclosing parallel" } +!$omp parallel do default(none) schedule(static, s) ! { dg-error "enclosing 'parallel'" } do i = 1, 8 call something end do diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 index a4633a3e9c0..1caa93df8c3 100644 --- a/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/pr44036-1.f90 @@ -11,14 +11,14 @@ subroutine foo(a, b) !$omp parallel default(none) private (x) x = a(4) !$omp end parallel -!$omp parallel default(none) private (x) ! { dg-error "enclosing parallel" } +!$omp parallel default(none) private (x) ! { dg-error "enclosing 'parallel'" } x = b(5) ! { dg-error "not specified in" } !$omp end parallel !$omp parallel default(none) private (x) x = c(6) !$omp end parallel d => a -!$omp parallel default(none) private (x) ! { dg-error "enclosing parallel" } +!$omp parallel default(none) private (x) ! { dg-error "enclosing 'parallel'" } x = d(7) ! { dg-error "not specified in" } !$omp end parallel end diff --git a/gcc/testsuite/gfortran.dg/gomp/pr44536.f90 b/gcc/testsuite/gfortran.dg/gomp/pr44536.f90 index 0dc896dccea..4fcf5d1102b 100644 --- a/gcc/testsuite/gfortran.dg/gomp/pr44536.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/pr44536.f90 @@ -4,7 +4,7 @@ subroutine foo (a, i, j) integer, dimension(:) :: a integer :: i, j -!$omp parallel default(none) shared(i, j) ! { dg-error "enclosing parallel" } +!$omp parallel default(none) shared(i, j) ! { dg-error "enclosing 'parallel'" } j=a(i) ! { dg-error "not specified in" } !$omp end parallel end subroutine diff --git a/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 b/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 index 7a107ffe7cb..ad9149ebe39 100644 --- a/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/sharing-1.f90 @@ -9,7 +9,7 @@ !$omp threadprivate (/thrblk/, thrpriv) s = 1 !$omp parallel do default (none) & -!$omp & private (p) shared (s) ! { dg-error "enclosing parallel" } +!$omp & private (p) shared (s) ! { dg-error "enclosing 'parallel'" } do i = 1, 64 call foo (thrpriv) ! Predetermined - threadprivate call foo (thr) ! Predetermined - threadprivate diff --git a/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 b/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 index b7d7e072975..bf5519070d4 100644 --- a/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/sharing-2.f90 @@ -9,7 +9,7 @@ j = 8 end do !$omp end parallel do -!$omp parallel default (none) shared (a) ! { dg-error "enclosing parallel" } +!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" } i = 1 j = 1 k = 1 @@ -28,7 +28,7 @@ end do !$omp end single !$omp end parallel -!$omp parallel default (none) shared (a) ! { dg-error "enclosing parallel" } +!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" } i = 1 ! { dg-error "not specified in" } j = 1 ! { dg-error "not specified in" } k = 1 ! { dg-error "not specified in" } @@ -54,21 +54,21 @@ j = 1 k = 1 !$omp end parallel -!$omp parallel default (none) shared (a) ! { dg-error "enclosing parallel" } +!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" } i = 1 ! { dg-error "not specified in" } !$omp do do i = 1, 10 a(i, 1) = i + 1 end do !$omp end parallel -!$omp parallel default (none) shared (a) ! { dg-error "enclosing parallel" } +!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" } i = 1 ! { dg-error "not specified in" } !$omp parallel do default (none) shared (a) do i = 1, 10 a(i, 1) = i + 1 end do !$omp end parallel -!$omp parallel default (none) shared (a) ! { dg-error "enclosing parallel" } +!$omp parallel default (none) shared (a) ! { dg-error "enclosing 'parallel'" } i = 1 ! { dg-error "not specified in" } !$omp parallel default (none) shared (a, i) i = 2 diff --git a/gcc/testsuite/gfortran.dg/gomp/sharing-3.f90 b/gcc/testsuite/gfortran.dg/gomp/sharing-3.f90 index 05be38283a9..221ec002371 100644 --- a/gcc/testsuite/gfortran.dg/gomp/sharing-3.f90 +++ b/gcc/testsuite/gfortran.dg/gomp/sharing-3.f90 @@ -25,7 +25,7 @@ subroutine foo (vara, varb, varc, vard, n) vard(1) = 1 vare(1) = 1 !$omp end parallel - !$omp parallel default(none) ! { dg-error "enclosing parallel" } + !$omp parallel default(none) ! { dg-error "enclosing 'parallel'" } !$omp master vara(1) = 1 ! { dg-error "not specified" } varb(1) = 1 ! Assumed-size is predetermined -- 2.30.2