[OG11][committed][PATCH 22/22] openacc: Adjust test expectations to new "kernels" handling

Frederik Harwath frederik@codesourcery.com
Wed Nov 17 16:03:30 GMT 2021


Adjust tests to changed expectations with the new Graphite-based
"kernels" handling.

libgomp/ChangeLog:

        * testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/pr84955-1.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/pr85381-2.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/pr85381-3.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/pr85381-4.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/pr85486-2.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/pr85486-3.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/pr85486.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/vector-length-128-1.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/vector-length-128-2.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/vector-length-128-3.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/vector-length-128-4.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/vector-length-128-5.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/vector-length-128-6.c: Adjust.
        * testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c: Adjust.
        * testsuite/libgomp.oacc-fortran/gangprivate-attrib-1.f90: Adjust.
        * testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90: Adjust.
        * testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction-2.f90: Adjust.
        * testsuite/libgomp.oacc-fortran/pr94358-1.f90: Adjust.
        * testsuite/libgomp.oacc-fortran/parallel-loop-auto-reduction-2.f90: Removed.

gcc/testsuite/ChangeLog:

        * c-c++-common/goacc/acc-icf.c: Adjust.
        * c-c++-common/goacc/cache-3-1.c: Adjust.
        * c-c++-common/goacc/classify-kernels-unparallelized-graphite.c: Adjust.
        * c-c++-common/goacc/classify-kernels.c: Adjust.
        * c-c++-common/goacc/classify-serial.c: Adjust.
        * c-c++-common/goacc/if-clause-2.c: Adjust.
        * c-c++-common/goacc/kernels-decompose-1.c: Adjust.
        * c-c++-common/goacc/kernels-decompose-2.c: Adjust.
        * c-c++-common/goacc/kernels-decompose-ice-1.c: Adjust.
        * c-c++-common/goacc/kernels-decompose-ice-2.c: Adjust.
        * c-c++-common/goacc/kernels-loop-3-acc-loop.c: Adjust.
        * c-c++-common/goacc/kernels-loop-3.c: Adjust.
        * c-c++-common/goacc/loop-2-kernels.c: Adjust.
        * c-c++-common/goacc/nested-reductions-2-parallel.c: Adjust.
        * c-c++-common/goacc/note-parallelism-1-kernels-loop-auto.c: Adjust.
        * c-c++-common/goacc/note-parallelism-1-kernels-loop-independent_seq.c: Adjust.
        * c-c++-common/goacc/note-parallelism-1-kernels-loops.c: Adjust.
        * c-c++-common/goacc/note-parallelism-1-kernels-straight-line.c: Adjust.
        * c-c++-common/goacc/note-parallelism-combined-kernels-loop-auto.c: Adjust.
        * c-c++-common/goacc/note-parallelism-combined-kernels-loop-independent_seq.c: Adjust.
        * c-c++-common/goacc/note-parallelism-kernels-conditional-loop-independent_seq.c: Adjust.
        * c-c++-common/goacc/note-parallelism-kernels-loop-auto.c: Adjust.
        * c-c++-common/goacc/note-parallelism-kernels-loop-independent_seq.c: Adjust.
        * c-c++-common/goacc/note-parallelism-kernels-loops.c: Adjust.
        * c-c++-common/goacc/routine-1.c: Adjust.
        * c-c++-common/goacc/routine-level-of-parallelism-2.c: Adjust.
        * c-c++-common/goacc/routine-nohost-1.c: Adjust.
        * c-c++-common/goacc/uninit-copy-clause.c: Adjust.
        * gcc.dg/goacc/loop-processing-1.c: Adjust.
        * gcc.dg/goacc/nested-function-1.c: Adjust.
        * gfortran.dg/goacc/classify-kernels-unparallelized.f95: Adjust.
        * gfortran.dg/goacc/classify-kernels.f95: Adjust.
        * gfortran.dg/goacc/classify-parallel.f95: Adjust.
        * gfortran.dg/goacc/classify-routine.f95: Adjust.
        * gfortran.dg/goacc/classify-serial.f95: Adjust.
        * gfortran.dg/goacc/common-block-3.f90: Adjust.
        * gfortran.dg/goacc/gang-static.f95: Adjust.
        * gfortran.dg/goacc/kernels-decompose-1.f95: Adjust.
        * gfortran.dg/goacc/kernels-decompose-2.f95: Adjust.
        * gfortran.dg/goacc/kernels-loop-2.f95: Adjust.
        * gfortran.dg/goacc/kernels-loop-data-2.f95: Adjust.
        * gfortran.dg/goacc/kernels-loop-inner.f95: Adjust.
        * gfortran.dg/goacc/kernels-loop.f95: Adjust.
        * gfortran.dg/goacc/kernels-tree.f95: Adjust.
        * gfortran.dg/goacc/loop-2-kernels.f95: Adjust.
        * gfortran.dg/goacc/loop-auto-transfer-2.f90: Adjust.
        * gfortran.dg/goacc/loop-auto-transfer-3.f90: Adjust.
        * gfortran.dg/goacc/loop-auto-transfer-4.f90: Adjust.
        * gfortran.dg/goacc/nested-function-1.f90: Adjust.
        * gfortran.dg/goacc/nested-reductions-2-parallel.f90: Adjust.
        * gfortran.dg/goacc/pr72741.f90: Adjust.
        * gfortran.dg/goacc/private-explicit-kernels-1.f95: Adjust.
        * gfortran.dg/goacc/private-predetermined-kernels-1.f95: Adjust.
        * gfortran.dg/goacc/routine-module-mod-1.f90: Adjust.
        * gfortran.dg/goacc/uninit-copy-clause.f95: Adjust.
        * c-c++-common/goacc/note-parallelism-1-kernels-conditional-loop-independent_seq.c: Removed.
---
 gcc/testsuite/c-c++-common/goacc/acc-icf.c    |   4 +-
 gcc/testsuite/c-c++-common/goacc/cache-3-1.c  |   2 +-
 ...classify-kernels-unparallelized-graphite.c |   4 +-
 .../c-c++-common/goacc/classify-kernels.c     |  23 +--
 .../c-c++-common/goacc/classify-serial.c      |  12 +-
 .../c-c++-common/goacc/if-clause-2.c          |   2 +-
 .../c-c++-common/goacc/kernels-decompose-1.c  |  31 ++-
 .../c-c++-common/goacc/kernels-decompose-2.c  |   2 +-
 .../goacc/kernels-decompose-ice-1.c           |   5 +-
 .../goacc/kernels-decompose-ice-2.c           |   3 +-
 .../goacc/kernels-loop-3-acc-loop.c           |   2 +-
 .../c-c++-common/goacc/kernels-loop-3.c       |   2 +-
 .../c-c++-common/goacc/loop-2-kernels.c       |  20 +-
 .../goacc/nested-reductions-2-parallel.c      | 138 +++++++++++++
 ...kernels-conditional-loop-independent_seq.c | 129 ------------
 .../note-parallelism-1-kernels-loop-auto.c    | 104 ++++++----
 ...rallelism-1-kernels-loop-independent_seq.c |  19 +-
 .../goacc/note-parallelism-1-kernels-loops.c  |   4 +-
 ...note-parallelism-1-kernels-straight-line.c |   2 +-
 ...e-parallelism-combined-kernels-loop-auto.c |  34 ++--
 ...sm-combined-kernels-loop-independent_seq.c |  16 --
 ...kernels-conditional-loop-independent_seq.c |  38 ++--
 .../note-parallelism-kernels-loop-auto.c      | 100 +++++-----
 ...parallelism-kernels-loop-independent_seq.c |  27 +--
 .../goacc/note-parallelism-kernels-loops.c    |  29 +--
 gcc/testsuite/c-c++-common/goacc/routine-1.c  |   2 +-
 .../goacc/routine-level-of-parallelism-2.c    |   2 -
 .../c-c++-common/goacc/routine-nohost-1.c     |   2 +-
 .../c-c++-common/goacc/uninit-copy-clause.c   |   6 -
 .../gcc.dg/goacc/loop-processing-1.c          |   2 +-
 .../gcc.dg/goacc/nested-function-1.c          |   3 +-
 .../goacc/classify-kernels-unparallelized.f95 |  26 +--
 .../gfortran.dg/goacc/classify-kernels.f95    |  26 +--
 .../gfortran.dg/goacc/classify-parallel.f95   |   6 +-
 .../gfortran.dg/goacc/classify-routine.f95    |   8 +-
 .../gfortran.dg/goacc/classify-serial.f95     |  11 +-
 .../gfortran.dg/goacc/common-block-3.f90      |  14 +-
 .../gfortran.dg/goacc/gang-static.f95         |  14 +-
 .../gfortran.dg/goacc/kernels-decompose-1.f95 | 183 ++++++++++++------
 .../gfortran.dg/goacc/kernels-decompose-2.f95 | 112 +++++++----
 .../gfortran.dg/goacc/kernels-loop-2.f95      |  13 +-
 .../gfortran.dg/goacc/kernels-loop-data-2.f95 |  13 +-
 .../gfortran.dg/goacc/kernels-loop-inner.f95  |   6 +-
 .../gfortran.dg/goacc/kernels-loop.f95        |  12 +-
 .../gfortran.dg/goacc/kernels-tree.f95        |   2 +-
 .../gfortran.dg/goacc/loop-2-kernels.f95      |  22 +--
 .../goacc/loop-auto-transfer-2.f90            |   2 -
 .../goacc/loop-auto-transfer-3.f90            |   8 -
 .../goacc/loop-auto-transfer-4.f90            |  30 ---
 .../gfortran.dg/goacc/nested-function-1.f90   |   2 +
 .../goacc/nested-reductions-2-parallel.f90    | 177 +++++++++++++++++
 gcc/testsuite/gfortran.dg/goacc/pr72741.f90   |   8 +-
 .../goacc/private-explicit-kernels-1.f95      |  13 +-
 .../goacc/private-predetermined-kernels-1.f95 |  16 +-
 .../goacc/routine-module-mod-1.f90            |   2 +-
 .../gfortran.dg/goacc/uninit-copy-clause.f95  |   2 -
 .../kernels-decompose-1.c                     |   5 +-
 .../libgomp.oacc-c-c++-common/parallel-dims.c |  34 ++--
 .../libgomp.oacc-c-c++-common/pr84955-1.c     |   1 -
 .../libgomp.oacc-c-c++-common/pr85381-2.c     |   8 +-
 .../libgomp.oacc-c-c++-common/pr85381-3.c     |   3 -
 .../libgomp.oacc-c-c++-common/pr85381-4.c     |   4 +-
 .../libgomp.oacc-c-c++-common/pr85486-2.c     |   2 +-
 .../libgomp.oacc-c-c++-common/pr85486-3.c     |   2 +-
 .../libgomp.oacc-c-c++-common/pr85486.c       |   2 +-
 .../vector-length-128-1.c                     |   5 +-
 .../vector-length-128-2.c                     |   5 +-
 .../vector-length-128-3.c                     |   5 +-
 .../vector-length-128-4.c                     |   5 +-
 .../vector-length-128-5.c                     |   5 +-
 .../vector-length-128-6.c                     |   5 +-
 .../vector-length-128-7.c                     |   5 +-
 .../gangprivate-attrib-1.f90                  |   3 +-
 .../gangprivate-attrib-2.f90                  |   3 +-
 .../kernels-acc-loop-reduction-2.f90          |  12 +-
 .../parallel-loop-auto-reduction-2.f90        |  98 ----------
 .../libgomp.oacc-fortran/pr94358-1.f90        |   2 -
 77 files changed, 908 insertions(+), 803 deletions(-)
 delete mode 100644 gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-conditional-loop-independent_seq.c
 delete mode 100644 libgomp/testsuite/libgomp.oacc-fortran/parallel-loop-auto-reduction-2.f90

diff --git a/gcc/testsuite/c-c++-common/goacc/acc-icf.c b/gcc/testsuite/c-c++-common/goacc/acc-icf.c
index bc2e0fd19b92..9cf119bf89c7 100644
--- a/gcc/testsuite/c-c++-common/goacc/acc-icf.c
+++ b/gcc/testsuite/c-c++-common/goacc/acc-icf.c
@@ -9,7 +9,7 @@
 /* { dg-bogus "warning: region is worker partitioned but does not contain worker partitioned code" "TODO default 'gang' 'vector'" { xfail *-*-* } .+3 }
    TODO It's the compiler's own decision to not use 'worker' parallelism here, so it doesn't make sense to bother the user about it.  */
 int
-routine1 (int n) /* { dg-bogus "region is worker partitioned but does not contain worker partitioned code" "" { xfail *-*-* } } */
+routine1 (int n)
 {
   int i;

@@ -24,7 +24,7 @@ routine1 (int n) /* { dg-bogus "region is worker partitioned but does not contai
 /* { dg-bogus "warning: region is worker partitioned but does not contain worker partitioned code" "TODO default 'gang' 'vector'" { xfail *-*-* } .+3 }
    TODO It's the compiler's own decision to not use 'worker' parallelism here, so it doesn't make sense to bother the user about it.  */
 int
-routine2 (int n) /* { dg-bogus "region is worker partitioned but does not contain worker partitioned code" "" { xfail *-*-* } } */
+routine2 (int n)
 {
   int i;

diff --git a/gcc/testsuite/c-c++-common/goacc/cache-3-1.c b/gcc/testsuite/c-c++-common/goacc/cache-3-1.c
index 5318a57d51e1..36235f6d49f4 100644
--- a/gcc/testsuite/c-c++-common/goacc/cache-3-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/cache-3-1.c
@@ -31,7 +31,7 @@ foo (int g[3][10], int h[4][8], int i[2][10], int j[][9],
     ;
   #pragma acc cache(t[2:5]) /* { dg-error "is threadprivate variable" } */
     ;
-  #pragma acc cache(k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
+ #pragma acc cache(k[0.5:]) /* { dg-error "low bound \[^\n\r]* of array section does not have integral type" } */
     ;
   #pragma acc cache(l[:7.5f]) /* { dg-error "length \[^\n\r]* of array section does not have integral type" } */
     ;
diff --git a/gcc/testsuite/c-c++-common/goacc/classify-kernels-unparallelized-graphite.c b/gcc/testsuite/c-c++-common/goacc/classify-kernels-unparallelized-graphite.c
index 77f4524907a9..721b34acd9a8 100644
--- a/gcc/testsuite/c-c++-common/goacc/classify-kernels-unparallelized-graphite.c
+++ b/gcc/testsuite/c-c++-common/goacc/classify-kernels-unparallelized-graphite.c
@@ -2,7 +2,6 @@
    OpenACC 'kernels' with Graphite kernles handling (default).  */

 /* { dg-additional-options "-O2" }
-   { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
    { dg-additional-options "-fopt-info-optimized-omp" }
    { dg-additional-options "-fopt-info-note-omp" }
    { dg-additional-options "-fdump-tree-ompexp" }
@@ -22,7 +21,8 @@ extern unsigned int f (unsigned int);
 void KERNELS ()
 {
 #pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N])
-  for (unsigned int i = 0; i < N; i++) /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
+  for (unsigned int i = 0; i < N; i++)
+    /* { dg-optimized "assigned OpenACC seq loop parallelism" "" { target *-*-* } .-1 } */
     /* An "extern"al mapping of loop iterations/array indices makes the loop
        unparallelizable.  */
     c[i] = a[f (i)] + b[f (i)]; /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
diff --git a/gcc/testsuite/c-c++-common/goacc/classify-kernels.c b/gcc/testsuite/c-c++-common/goacc/classify-kernels.c
index 7aaebeff2828..5abda60ed4a7 100644
--- a/gcc/testsuite/c-c++-common/goacc/classify-kernels.c
+++ b/gcc/testsuite/c-c++-common/goacc/classify-kernels.c
@@ -2,10 +2,9 @@
    'kernels' (parloops version).  */

 /* { dg-additional-options "-O2" }
-   { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
-   { dg-additional-options "-fopt-info-note-optimized-omp" }
+   { dg-additional-options "-fopt-info-optimized-omp" }
+   { dg-additional-options "-fopt-info-note-omp" }
    { dg-additional-options "-fdump-tree-ompexp" }
-   { dg-additional-options "-fdump-tree-parloops1-all" }
    { dg-additional-options "-fdump-tree-oaccloops1" } */

 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
@@ -19,22 +18,14 @@ extern unsigned int *__restrict c;

 void KERNELS ()
 {
-#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  for (unsigned int i = 0; i < N; i++) /* { dg-message "note: beginning .Graphite. region in OpenACC .kernels. construct" } */
+#pragma acc kernels copyin (a[0:N], b[0:N]) copyout (c[0:N])
+  for (unsigned int i = 0; i < N; i++)  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" } */
+    /* { dg-optimized "assigned OpenACC gang vector loop parallelism" "" { target *-*-* } .-1 } */
     c[i] = a[i] + b[i];
 }

-/* Check the offloaded function's attributes.
-   { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint\\)\\)" 1 "ompexp" } } */
-
-/* Check that exactly one OpenACC kernels construct is analyzed, and that it
-   can be parallelized.
-   { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops1" } }
-   { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "parloops1" } }
-   { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } } */
-
 /* Check the offloaded function's classification and compute dimensions (will
    always be 1 x 1 x 1 for non-offloading compilation).
-   { dg-final { scan-tree-dump-times "(?n)Function is parallelized OpenACC kernels offload" 1 "oaccloops1" } }
+   { dg-final { scan-tree-dump-times "(?n)Function is parallel_kernels_graphite OpenACC kernels offload" 1 "oaccloops1" } }
    { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops1" } }
-   { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "oaccloops1" } } */
+   { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc parallel_kernels_graphite, omp target entrypoint\\)\\)" 1 "oaccloops1" } } */
diff --git a/gcc/testsuite/c-c++-common/goacc/classify-serial.c b/gcc/testsuite/c-c++-common/goacc/classify-serial.c
index 0c21919758bb..98df04563ba4 100644
--- a/gcc/testsuite/c-c++-common/goacc/classify-serial.c
+++ b/gcc/testsuite/c-c++-common/goacc/classify-serial.c
@@ -4,7 +4,7 @@
 /* { dg-additional-options "-O2 -w" }
    { dg-additional-options "-fopt-info-optimized-omp" }
    { dg-additional-options "-fdump-tree-ompexp" }
-   { dg-additional-options "-fdump-tree-oaccloops" } */
+   { dg-additional-options "-fdump-tree-oaccloops1" } */

 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
    aspects of that functionality.  */
@@ -18,9 +18,7 @@ extern unsigned int *__restrict c;
 void SERIAL ()
 {
 #pragma acc serial loop copyin (a[0:N], b[0:N]) copyout (c[0:N]) /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
-  /* { dg-bogus "warning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-1 }
-     { dg-bogus "warning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 }
-     { dg-bogus "warning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 }
+  /* { dg-bogus "warning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 }
      TODO Should we really diagnose this if the user explicitly requested 'serial'?
      TODO Should we instead diagnose ('-Wextra' category?) that the user may enable use of parallelism if replacing 'serial' with 'parallel', if applicable?  */
   for (unsigned int i = 0; i < N; i++)
@@ -32,6 +30,6 @@ void SERIAL ()

 /* Check the offloaded function's classification and compute dimensions (will
    always be 1 x 1 x 1 for non-offloading compilation).
-   { dg-final { scan-tree-dump-times "(?n)Function is OpenACC serial offload" 1 "oaccloops" } }
-   { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
-   { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc serial, omp target entrypoint\\)\\)" 1 "oaccloops" } } */
+   { dg-final { scan-tree-dump-times "(?n)Function is OpenACC serial offload" 1 "oaccloops1" } }
+   { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops1" } }
+   { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc serial, omp target entrypoint\\)\\)" 1 "oaccloops1" } } */
diff --git a/gcc/testsuite/c-c++-common/goacc/if-clause-2.c b/gcc/testsuite/c-c++-common/goacc/if-clause-2.c
index a48072509e1a..96e36cac6eed 100644
--- a/gcc/testsuite/c-c++-common/goacc/if-clause-2.c
+++ b/gcc/testsuite/c-c++-common/goacc/if-clause-2.c
@@ -11,7 +11,7 @@ f (short c)
 #pragma acc kernels if(c) copy(c)
   /* { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_kernels map\(tofrom:c \[len: [0-9]+\]\) if\(_[0-9]+\)$} 1 "gimple" } } */
   /* { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_data_kernels map\(tofrom:c \[len: [0-9]+\]\) if\(_[0-9]+\)$} 1 "omp_oacc_kernels_decompose" } }
-     { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_gang_single async\(-1\) num_gangs\(1\) map\(force_present:c \[len: [0-9]+\]\) if\(_[0-9]+\)$} 1 "omp_oacc_kernels_decompose" } } */
+     { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_graphite async\(-1\) map\(force_present:c \[len: [0-9]+\]\) if\(_[0-9]+\)$} 1 "omp_oacc_kernels_decompose" } } */
   ++c;

 #pragma acc data if(c) copy(c)
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-1.c b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-1.c
index f549cbadfa7e..b9e14852fbef 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-1.c
@@ -1,9 +1,11 @@
 /* Test OpenACC 'kernels' construct decomposition.  */
+/* { dg-additional-options "-fopt-info-optimized-omp" } */
+/* { dg-additional-options "-O2" } for "Graphite".  */

 /* { dg-additional-options "-fopt-info-omp-all" } */
 /* { dg-additional-options "-fdump-tree-gimple" } */
 /* { dg-additional-options "--param=openacc-kernels=decompose" }
-   { dg-additional-options "-fdump-tree-omp_oacc_kernels_decompose" } */
+   { dg-additional-options "-fdump-tree-omp_oacc_kernels_decompose-details" } */

 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
    aspects of that functionality.  */
@@ -28,36 +30,34 @@ main (void)
   int i;
   unsigned int sum = 1;

-#pragma acc kernels copyin(a[0:N]) copy(sum)
-  /* { dg-bogus "optimized: assigned OpenACC seq loop parallelism" "TODO" { xfail *-*-* } .-1 }
-     TODO Is this maybe the report that belongs to the XFAILed report further down?  */
+#pragma acc kernels copyin(a[0:N]) copy(sum) /* { dg-line l_kernels_pragma } */
+  /* { dg-missed {'map\(tofrom:sum \[len: [0-9]+\]\)' not optimized: 'sum' is unsuitable for privatization} "TODO Missing synthetic reduction clause" { target *-*-* } l_kernels_pragma } */
   {
     #pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
-    /* { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis" "" { target *-*-* } l_loop_i$c_loop_i } */
     /* { dg-optimized "assigned OpenACC seq loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i } */
     for (i = 0; i < N; ++i)
       sum += a[i];

-    sum++; /* { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" } */
+    sum++;
     a[0]++;

     #pragma acc loop independent /* { dg-line l_loop_i[incr c_loop_i] } */
-    /* { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_i$c_loop_i } */
-    /* { dg-optimized "assigned OpenACC gang vector loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i } */
+    /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } l_loop_i$c_loop_i } */
+    /* { dg-optimized "assigned OpenACC gang vector loop parallelism" "" {target *-*-* } l_loop_i$c_loop_i } */
+    /* { dg-warning {loop has "independent" clause but data dependences were found.} "" { target *-*-* } l_loop_i$c_loop_i } */
     for (i = 0; i < N; ++i)
       sum += a[i];

-    if (sum > 10) /* { dg-message "note: beginning 'parloops' part in OpenACC 'kernels' region" } */
+    if (sum > 10)
       {
         #pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
        /* { dg-missed "unparallelized loop nest in OpenACC 'kernels' region: it's executed conditionally" "" { target *-*-* } l_loop_i$c_loop_i } */
-       /*TODO { dg-optimized "assigned OpenACC seq loop parallelism" "TODO" { xfail *-*-* } l_loop_i$c_loop_i } */
+       /* { dg-optimized "assigned OpenACC seq loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i } */
         for (i = 0; i < N; ++i)
           sum += a[i];
       }

     #pragma acc loop auto /* { dg-line l_loop_i[incr c_loop_i] } */
-    /* { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis" "" { target *-*-* } l_loop_i$c_loop_i } */
     /* { dg-optimized "assigned OpenACC seq loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i } */
     for (i = 0; i < N; ++i)
       sum += a[i];
@@ -77,18 +77,17 @@ main (void)
    sequence of compute constructs.
    { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_data_kernels map\(tofrom:sum \[len: [0-9]+\]\) map\(to:a\[0\] \[len: [0-9]+\]\)$} 1 "omp_oacc_kernels_decompose" } }
    As noted above, we get three "old-style" kernel regions, one gang-single region, and one parallelized loop region.
-   { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_kernels async\(-1\) map\(force_present:sum \[len: [0-9]+\]\) map\(force_present:a\[0\] \[len: [0-9]+\]\) map\(firstprivate:a \[pointer assign, bias: 0\]\)$} 3 "omp_oacc_kernels_decompose" } }
-   { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_parallelized async\(-1\) map\(force_present:sum \[len: [0-9]+\]\) map\(force_present:a\[0\] \[len: [0-9]+\]\) map\(firstprivate:a \[pointer assign, bias: 0\]\)$} 1 "omp_oacc_kernels_decompose" } }
-   { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_gang_single async\(-1\) num_gangs\(1\) map\(force_present:sum \[len: [0-9]+\]\) map\(force_present:a\[0\] \[len: [0-9]+\]\) map\(firstprivate:a \[pointer assign, bias: 0\]\)$} 1 "omp_oacc_kernels_decompose" } }
+   { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_graphite async\(-1\) map\(force_present:sum \[len: [0-9]+\]\) map\(force_present:a\[0\] \[len: [0-9]+\]\) map\(firstprivate:a \[pointer assign, bias: 0\]\)$} 5 "omp_oacc_kernels_decompose" } }

    'data' plus five CCs.
    { dg-final { scan-tree-dump-times {(?n)#pragma omp target } 6 "omp_oacc_kernels_decompose" } }

-   { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\)$} 2 "omp_oacc_kernels_decompose" } }
+   { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\)$} 1 "omp_oacc_kernels_decompose" } }
    { dg-final { scan-tree-dump-times {(?n)#pragma acc loop independent private\(i\)$} 1 "omp_oacc_kernels_decompose" } }
-   { dg-final { scan-tree-dump-times {(?n)#pragma acc loop auto private\(i\)$} 1 "omp_oacc_kernels_decompose" } }
+   { dg-final { scan-tree-dump-times {(?n)#pragma acc loop auto private\(i\)$} 2 "omp_oacc_kernels_decompose" } }
    { dg-final { scan-tree-dump-times {(?n)#pragma acc loop} 4 "omp_oacc_kernels_decompose" } }

    Each of the parallel regions is async, and there is a final call to
    __builtin_GOACC_wait.
    { dg-final { scan-tree-dump-times "__builtin_GOACC_wait" 1 "omp_oacc_kernels_decompose" } } */
+
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-2.c b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-2.c
index f5f6a7e3e8b7..4eb030d4ce08 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-2.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-2.c
@@ -2,7 +2,7 @@

 /* { dg-additional-options "-fno-openacc-kernels-annotate-loops" } */
 /* { dg-additional-options "-fopt-info-omp-all" } */
-/* { dg-additional-options "--param=openacc-kernels=decompose" }
+/* { dg-additional-options "--param=openacc-kernels=decompose-parloops" }
 /* { dg-additional-options "-O2" } for 'parloops'.  */

 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-1.c b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-1.c
index 5e0031f76c12..6701219d28bc 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-1.c
@@ -1,9 +1,8 @@
 /* Test OpenACC 'kernels' construct decomposition.  */

-/* { dg-additional-options "-fopt-info-omp-all" } */
+/* { dg-additional-options "-fopt-info-omp-optimized" } */
 /* { dg-additional-options "-fchecking --param=openacc-kernels=decompose" } */
-/* { dg-ice "TODO" }
-   { dg-prune-output "during GIMPLE pass: omplower" } */
+/* { dg-prune-output "during GIMPLE pass: omplower" } */

 /* Reduced from 'kernels-decompose-2.c'.
    (Hopefully) similar instances:
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-2.c b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-2.c
index 8bf60a9a5099..8de4b452fbc5 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-2.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-2.c
@@ -1,8 +1,7 @@
 /* Test OpenACC 'kernels' construct decomposition.  */

 /* { dg-additional-options "-fchecking --param=openacc-kernels=decompose" } */
-/* { dg-ice "TODO" }
-   { dg-prune-output "during GIMPLE pass: omplower" } */
+/* { dg-prune-output "during GIMPLE pass: omplower" } */

 /* Reduced from 'kernels-decompose-ice-1.c'.  */

diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-loop-3-acc-loop.c b/gcc/testsuite/c-c++-common/goacc/kernels-loop-3-acc-loop.c
index e715c488e947..a9098ac531f2 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-loop-3-acc-loop.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-loop-3-acc-loop.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "--param=openacc-kernels=parloops" } as this is
+/* { dg-additional-options "--param openacc-kernels=decompose-parloops" } as this is
    specifically testing "parloops" handling.  */
 /* { dg-additional-options "-O2" } */
 /* { dg-additional-options "-fdump-tree-parloops1-all" } */
diff --git a/gcc/testsuite/c-c++-common/goacc/kernels-loop-3.c b/gcc/testsuite/c-c++-common/goacc/kernels-loop-3.c
index c1aae7ffc19b..ae812583cf97 100644
--- a/gcc/testsuite/c-c++-common/goacc/kernels-loop-3.c
+++ b/gcc/testsuite/c-c++-common/goacc/kernels-loop-3.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "--param=openacc-kernels=parloops" } as this is
+/* { dg-additional-options "--param openacc-kernels=decompose-parloops" } as this is
    specifically testing "parloops" handling.  */
 /* { dg-additional-options "-O2" } */
 /* { dg-additional-options "-fno-openacc-kernels-annotate-loops" } */
diff --git a/gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c b/gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c
index c989222669c0..143ef0a7905a 100644
--- a/gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c
+++ b/gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c
@@ -37,7 +37,7 @@ void K(void)
        for (j = 0; j < 10; j++)
          { }
       }
-#pragma acc loop seq gang // { dg-error "'seq' overrides" "TODO" { xfail *-*-* } }
+#pragma acc loop seq gang // { dg-error "'seq' overrides" }
     for (i = 0; i < 10; i++)
       { }

@@ -59,11 +59,11 @@ void K(void)
 #pragma acc loop worker // { dg-error "inner loop uses same" }
        for (j = 0; j < 10; j++)
          { }
-#pragma acc loop gang
+#pragma acc loop gang /* { dg-bogus "incorrectly nested OpenACC loop parallelism" "TODO-kernels" { xfail *-*-* } } */
        for (j = 0; j < 10; j++)
          { }
       }
-#pragma acc loop seq worker // { dg-error "'seq' overrides" "TODO" { xfail *-*-* } }
+#pragma acc loop seq worker // { dg-error "'seq' overrides" }
     for (i = 0; i < 10; i++)
       { }
 #pragma acc loop gang worker
@@ -85,14 +85,14 @@ void K(void)
 #pragma acc loop vector // { dg-error "inner loop uses same" }
        for (j = 1; j < 10; j++)
          { }
-#pragma acc loop worker
+#pragma acc loop worker /* { dg-bogus "incorrectly nested OpenACC loop parallelism" "TODO-kernels" { xfail *-*-* } } */
        for (j = 1; j < 10; j++)
          { }
-#pragma acc loop gang
+#pragma acc loop gang /* { dg-bogus "incorrectly nested OpenACC loop parallelism" "TODO-kernels" { xfail *-*-* } } */
        for (j = 1; j < 10; j++)
          { }
       }
-#pragma acc loop seq vector // { dg-error "'seq' overrides" "TODO" { xfail *-*-* } }
+#pragma acc loop seq vector // { dg-error "'seq' overrides" }
     for (i = 0; i < 10; i++)
       { }
 #pragma acc loop gang vector
@@ -105,7 +105,7 @@ void K(void)
 #pragma acc loop auto
     for (i = 0; i < 10; i++)
       { }
-#pragma acc loop seq auto // { dg-error "'seq' overrides" "TODO" { xfail *-*-* } }
+#pragma acc loop seq auto // { dg-error "'seq' overrides" }
     for (i = 0; i < 10; i++)
       { }
 #pragma acc loop gang auto // { dg-error "'auto' conflicts" }
@@ -147,7 +147,7 @@ void K(void)
 #pragma acc kernels loop worker(num:5)
   for (i = 0; i < 10; i++)
     { }
-#pragma acc kernels loop seq worker // { dg-error "'seq' overrides" "TODO" { xfail *-*-* } }
+#pragma acc kernels loop seq worker // { dg-error "'seq' overrides" }
   for (i = 0; i < 10; i++)
     { }
 #pragma acc kernels loop gang worker
@@ -163,7 +163,7 @@ void K(void)
 #pragma acc kernels loop vector(length:5)
   for (i = 0; i < 10; i++)
     { }
-#pragma acc kernels loop seq vector // { dg-error "'seq' overrides" "TODO" { xfail *-*-* } }
+#pragma acc kernels loop seq vector // { dg-error "'seq' overrides" }
   for (i = 0; i < 10; i++)
     { }
 #pragma acc kernels loop gang vector
@@ -176,7 +176,7 @@ void K(void)
 #pragma acc kernels loop auto
   for (i = 0; i < 10; i++)
     { }
-#pragma acc kernels loop seq auto // { dg-error "'seq' overrides" "TODO" { xfail *-*-* } }
+#pragma acc kernels loop seq auto // { dg-error "'seq' overrides" }
   for (i = 0; i < 10; i++)
     { }
 #pragma acc kernels loop gang auto // { dg-error "'auto' conflicts" }
diff --git a/gcc/testsuite/c-c++-common/goacc/nested-reductions-2-parallel.c b/gcc/testsuite/c-c++-common/goacc/nested-reductions-2-parallel.c
index 1f6b4e78293b..fb679f349abd 100644
--- a/gcc/testsuite/c-c++-common/goacc/nested-reductions-2-parallel.c
+++ b/gcc/testsuite/c-c++-common/goacc/nested-reductions-2-parallel.c
@@ -387,3 +387,141 @@ void acc_parallel_loop_reduction (void)
       }
   }
 }
+
+/* The same tests as above, but inside a routine construct.  */
+#pragma acc routine gang
+void acc_routine (void)
+{
+  int i, j, k, l, sum, diff;
+
+  {
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      for (j = 0; j < 10; j++)
+        #pragma acc loop reduction(+:sum)
+        for (k = 0; k < 10; k++)
+          sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop collapse(2) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      for (j = 0; j < 10; j++)
+        for (k = 0; k < 10; k++)
+          #pragma acc loop reduction(+:sum)
+          for (l = 0; l < 10; l++)
+            sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      for (j = 0; j < 10; j++)
+        #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+        // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+       for (k = 0; k < 10; k++)
+          #pragma acc loop reduction(+:sum)
+          for (l = 0; l < 10; l++)
+            sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+      for (j = 0; j < 10; j++)
+        #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." }
+        for (k = 0; k < 10; k++)
+          sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+      for (j = 0; j < 10; j++)
+        #pragma acc loop reduction(-:sum)
+        for (k = 0; k < 10; k++)
+          sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+      for (j = 0; j < 10; j++)
+        #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+        // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+        for (k = 0; k < 10; k++)
+         #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+         for (l = 0; l < 10; l++)
+           sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+      for (j = 0; j < 10; j++)
+      #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." })
+      // { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+        for (k = 0; k < 10; k++)
+         #pragma acc loop reduction(*:sum) // { dg-warning "conflicting reduction operations for .sum." }
+         for (l = 0; l < 10; l++)
+           sum = 1;
+
+    #pragma acc loop reduction(+:sum) reduction(-:diff)
+    for (i = 0; i < 10; i++)
+      {
+        #pragma acc loop reduction(-:diff) // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+        for (j = 0; j < 10; j++)
+          #pragma acc loop reduction(+:sum)
+          for (k = 0; k < 10; k++)
+            sum = 1;
+
+        #pragma acc loop reduction(+:sum) // { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+        for (j = 0; j < 10; j++)
+          #pragma acc loop reduction(-:diff)
+          for (k = 0; k < 10; k++)
+            diff = 1;
+      }
+  }
+}
+
+void acc_kernels (void)
+{
+  int i, j, k, sum, diff;
+
+  /* FIXME:  No diagnostics are produced for these loops because reductions
+     in kernels regions are not supported yet.  */
+  #pragma acc kernels
+  {
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      for (j = 0; j < 10; j++)
+        for (k = 0; k < 10; k++)
+          sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop
+      for (j = 0; j < 10; j++)
+        for (k = 0; k < 10; k++)
+          sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop reduction(-:diff)
+      for (j = 0; j < 10; j++)
+        #pragma acc loop
+        for (k = 0; k < 10; k++)
+          sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop // { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      for (j = 0; j < 10; j++)
+        #pragma acc loop reduction(+:sum)
+        for (k = 0; k < 10; k++)
+          sum = 1;
+
+    #pragma acc loop reduction(+:sum)
+    for (i = 0; i < 10; i++)
+      #pragma acc loop reduction(-:sum) // { dg-warning "conflicting reduction operations for .sum." }
+      for (j = 0; j < 10; j++)
+        #pragma acc loop reduction(+:sum) // { dg-warning "conflicting reduction operations for .sum." }
+        for (k = 0; k < 10; k++)
+          sum = 1;
+  }
+}
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-conditional-loop-independent_seq.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-conditional-loop-independent_seq.c
deleted file mode 100644
index b3f4e24173af..000000000000
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-conditional-loop-independent_seq.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Test the output of "-fopt-info-optimized-omp" for an OpenACC 'kernels'
-   construct containing conditionally executed 'loop' constructs with
-   'independent' or 'seq' clauses.  */
-
-/* { dg-additional-options "-fopt-info-all-omp" } */
-
-//TODO update accordingly
-/* See also "../../gfortran.dg/goacc/note-parallelism.f90".  */
-
-extern int c;
-
-int
-main ()
-{
-  int x, y, z;
-
-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
- /* Strangely indented to keep this similar to other test cases.  */
-  if (c) /* { dg-message "optimized: beginning .Graphite. region in OpenACC .kernels. construct" } */
- {
-#pragma acc loop seq
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent gang
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent worker
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent vector
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent gang vector
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent gang worker
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent worker vector
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent gang worker vector
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent gang
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-#pragma acc loop independent worker
-    for (y = 0; y < 10; y++)
-#pragma acc loop independent vector
-      for (z = 0; z < 10; z++)
-       ;
-
-#pragma acc loop independent
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-    ;
-
-#pragma acc loop independent
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-#pragma acc loop independent
-    for (y = 0; y < 10; y++)
-      ;
-
-#pragma acc loop independent
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-#pragma acc loop independent
-    for (y = 0; y < 10; y++)
-#pragma acc loop independent
-      for (z = 0; z < 10; z++)
-       ;
-
-#pragma acc loop seq
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-#pragma acc loop independent
-    for (y = 0; y < 10; y++)
-#pragma acc loop independent
-      for (z = 0; z < 10; z++)
-       ;
-
-#pragma acc loop independent
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-#pragma acc loop seq
-    for (y = 0; y < 10; y++)
-#pragma acc loop independent
-      for (z = 0; z < 10; z++)
-       ;
-
-#pragma acc loop independent
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-#pragma acc loop independent
-    for (y = 0; y < 10; y++)
-#pragma acc loop seq
-      for (z = 0; z < 10; z++)
-       ;
-
-#pragma acc loop seq
-  /* { dg-message "missed: unparallelized loop nest in OpenACC .kernels. region: it's executed conditionally" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-#pragma acc loop independent
-    for (y = 0; y < 10; y++)
-#pragma acc loop seq
-      for (z = 0; z < 10; z++)
-       ;
- }
-
-  return 0;
-}
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loop-auto.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loop-auto.c
index b0313796adee..8ad662524972 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loop-auto.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loop-auto.c
@@ -2,6 +2,7 @@
    construct containing 'loop' constructs with explicit or implicit 'auto'
    clause.  */

+/* { dg-additional-options "-fopt-info-optimized-omp" } */
 /* { dg-additional-options "-fopt-info-note-omp" } */

 //TODO update accordingly
@@ -15,109 +16,136 @@ main ()
 #pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  {
-#pragma acc loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

-#pragma acc loop auto gang /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang
+  /* { dg-message "optimized: assigned OpenACC gang loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-3 } */
   for (x = 0; x < 10; x++)
     ;

-#pragma acc loop auto worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto worker
+  /* { dg-message "optimized: assigned OpenACC worker loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-3 } */
   for (x = 0; x < 10; x++)
     ;

-#pragma acc loop auto vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto vector
+  /* { dg-message "optimized: assigned OpenACC vector loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-3 } */
   for (x = 0; x < 10; x++)
     ;

-#pragma acc loop auto gang vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang vector
+  /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-3 } */
   for (x = 0; x < 10; x++)
     ;

-#pragma acc loop auto gang worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang worker
+  /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-3 } */
   for (x = 0; x < 10; x++)
     ;

-#pragma acc loop auto worker vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto worker vector
+  /* { dg-message "optimized: assigned OpenACC worker vector loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-3 } */
   for (x = 0; x < 10; x++)
     ;

-#pragma acc loop auto gang worker vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang worker vector
+  /* { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-3 } */
   for (x = 0; x < 10; x++)
     ;

-#pragma acc loop auto gang /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang
+  /* { dg-message "optimized: assigned OpenACC gang loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-3 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
+#pragma acc loop auto worker
+  /* { dg-message "optimized: assigned OpenACC worker loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-2 } */
     for (y = 0; y < 10; y++)
-#pragma acc loop auto vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
+#pragma acc loop auto vector
+  /* { dg-message "optimized: assigned OpenACC vector loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-*} .-2 } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "optimized: assigned OpenACC seq loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "optimized: assigned OpenACC seq loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
       ;

 #pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "optimized: assigned OpenACC seq loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "optimized: assigned OpenACC seq loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "optimized: assigned OpenACC seq loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop
+#pragma acc loop /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "optimized: assigned OpenACC seq loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop
+#pragma acc loop /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "optimized: assigned OpenACC seq loop parallelism" "" { target *-*-*} .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop
+#pragma acc loop /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;
  }
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loop-independent_seq.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loop-independent_seq.c
index 9eb846325a63..8d20840ef281 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loop-independent_seq.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loop-independent_seq.c
@@ -3,10 +3,13 @@
    clauses.  */

 /* { dg-additional-options "-fopt-info-all-omp" } */
+/* { dg-additional-options "-O2" } */

 //TODO update accordingly
 /* See also "../../gfortran.dg/goacc/note-parallelism.f90".  */

+/* { dg-prune-output "^.*?loop in .kernels. region has not been analyzed.*?$" } */
+
 int
 main ()
 {
@@ -16,47 +19,38 @@ main ()
  /* Strangely indented to keep this similar to other test cases.  */
  {
 #pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent gang /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent worker /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent vector /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent gang vector /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent gang worker /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent worker vector /* { dg-message "optimized: assigned OpenACC worker vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent gang worker vector /* { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent gang /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent worker /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -65,19 +59,16 @@ main ()
        ;

 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
     for (y = 0; y < 10; y++)
       ;

 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -86,7 +77,6 @@ main ()
        ;

 #pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -95,7 +85,6 @@ main ()
        ;

 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -104,7 +93,6 @@ main ()
        ;

 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -113,7 +101,6 @@ main ()
        ;

 #pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
     for (y = 0; y < 10; y++)
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loops.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loops.c
index 6cf51904e7ad..524112357659 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loops.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-loops.c
@@ -2,7 +2,7 @@
    construct containing loops.  */

 /* { dg-additional-options "-fno-openacc-kernels-annotate-loops" } */
-/* { dg-additional-options "-fopt-info-optimized-omp-note" } */
+/* { dg-additional-options "-fopt-info-optimized-note-omp" } */

 //TODO update accordingly
 /* See also "../../gfortran.dg/goacc/note-parallelism.f90".  */
@@ -20,7 +20,7 @@ main ()

  /* Strangely indented to keep this similar to other test cases.  */
  {
-  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. region in OpenACC .kernels. construct" } */
+  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
     ;

   for (x = 0; x < 10; x++)
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-straight-line.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-straight-line.c
index d4cb2364737c..a3fc0cb96578 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-straight-line.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-1-kernels-straight-line.c
@@ -37,7 +37,7 @@ main ()
   /* { dg-optimized {'map\(force_tofrom:x \[len: [0-9]+\]\[implicit\]\)' optimized to 'map\(to:x \[len: [0-9]+\]\[implicit\]\)'} "" { target *-*-* } l_pragma_kernels } */
   /* { dg-optimized {'map\(to:x \[len: [0-9]+\]\[implicit\]\)' further optimized to 'private\(x\)'} "" { target *-*-* } l_pragma_kernels } */
   {
-    x = 0; /* { dg-message "note: beginning .gang-single. part in OpenACC .kernels. region" } */
+    x = 0; /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
     y = x < 10;
     z = x++;
     ;
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-combined-kernels-loop-auto.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-combined-kernels-loop-auto.c
index a4f721067ccf..a189ef498c22 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-combined-kernels-loop-auto.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-combined-kernels-loop-auto.c
@@ -1,4 +1,4 @@
-/* Test the output of "-fopt-info-optimized-omp" for combined OpenACC 'kernels
+/* Test the output of "-fopt-info-note-omp" for combined OpenACC 'kernels
    loop' constructs with explicit or implicit 'auto' clause.  */

 /* { dg-additional-options "-fopt-info-note-omp" } */
@@ -12,47 +12,47 @@ main ()
   int x, y, z;

 #pragma acc kernels loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto gang /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto gang vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto gang worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto worker vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto gang worker vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto gang /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop auto worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
     for (y = 0; y < 10; y++)
@@ -61,19 +61,19 @@ main ()
        ;

 #pragma acc kernels loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop auto
     for (y = 0; y < 10; y++)
       ;

 #pragma acc kernels loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop auto
     for (y = 0; y < 10; y++)
@@ -82,7 +82,7 @@ main ()
        ;

 #pragma acc kernels loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop auto
     for (y = 0; y < 10; y++)
@@ -91,7 +91,7 @@ main ()
        ;

 #pragma acc kernels loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop
     for (y = 0; y < 10; y++)
@@ -100,7 +100,7 @@ main ()
        ;

 #pragma acc kernels loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop auto
     for (y = 0; y < 10; y++)
@@ -109,7 +109,7 @@ main ()
        ;

 #pragma acc kernels loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop auto
     for (y = 0; y < 10; y++)
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-combined-kernels-loop-independent_seq.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-combined-kernels-loop-independent_seq.c
index 54960918d8c2..9ad36a9ab5f0 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-combined-kernels-loop-independent_seq.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-combined-kernels-loop-independent_seq.c
@@ -12,47 +12,38 @@ main ()
   int x, y, z;

 #pragma acc kernels loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent gang /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent worker /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent vector /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent gang vector /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent gang worker /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent worker vector /* { dg-message "optimized: assigned OpenACC worker vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent gang worker vector /* { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent gang /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent worker /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -61,19 +52,16 @@ main ()
        ;

 #pragma acc kernels loop independent /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
     for (y = 0; y < 10; y++)
       ;

 #pragma acc kernels loop independent /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -82,7 +70,6 @@ main ()
        ;

 #pragma acc kernels loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -91,7 +78,6 @@ main ()
        ;

 #pragma acc kernels loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -100,7 +86,6 @@ main ()
        ;

 #pragma acc kernels loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -109,7 +94,6 @@ main ()
        ;

 #pragma acc kernels loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
     for (y = 0; y < 10; y++)
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-conditional-loop-independent_seq.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-conditional-loop-independent_seq.c
index 0a3babe7a44c..c26a7b40951f 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-conditional-loop-independent_seq.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-conditional-loop-independent_seq.c
@@ -1,8 +1,10 @@
-/* Test the output of "-fopt-info-optimized-omp" for OpenACC 'kernels'
+/* Test the output of "-fopt-info-note-omp" for OpenACC 'kernels'
    constructs containing conditionally executed 'loop' constructs with
    'independent' or 'seq' clauses.  */

-/* { dg-additional-options "-fopt-info-all-omp" } */
+/* { dg-additional-options "-fopt-info-note-omp" } */
+/* { dg-additional-options "-fopt-info-missed-omp" } */
+/* { dg-additional-options "--param openacc-kernels=decompose-parloops" } */

 //TODO update accordingly
 /* See also "../../gfortran.dg/goacc/note-parallelism.f90".  */
@@ -14,7 +16,7 @@ main ()
 {
   int x, y, z;

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -24,7 +26,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -34,7 +36,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -44,7 +46,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -54,7 +56,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -64,7 +66,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -74,7 +76,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -84,7 +86,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -94,7 +96,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -108,7 +110,7 @@ main ()
        ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -118,7 +120,7 @@ main ()
     ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -130,7 +132,7 @@ main ()
       ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -144,7 +146,7 @@ main ()
        ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -158,7 +160,7 @@ main ()
        ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -172,7 +174,7 @@ main ()
        ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
@@ -186,7 +188,7 @@ main ()
        ;
  }

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
+#pragma acc kernels
  /* Strangely indented to keep this similar to other test cases.  */
  if (c) /* { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" } */
  {
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loop-auto.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loop-auto.c
index 4f17204d1991..c9a39eb54ef9 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loop-auto.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loop-auto.c
@@ -13,124 +13,134 @@ main ()
   int x, y, z;

 #pragma acc kernels
-#pragma acc loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto gang /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang /* { dg-optimized "assigned OpenACC gang loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto worker /* { dg-optimized "assigned OpenACC worker loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto vector /* { dg-optimized "assigned OpenACC vector loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto gang vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang vector /* { dg-optimized "assigned OpenACC gang vector loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto gang worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang worker /* { dg-optimized "assigned OpenACC gang worker loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto worker vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto worker vector /* { dg-optimized "assigned OpenACC worker vector loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto gang worker vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang worker vector /* { dg-optimized "assigned OpenACC gang worker vector loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto gang /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto gang /* { dg-optimized "assigned OpenACC gang loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto worker /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
+#pragma acc loop auto worker /* { dg-optimized "assigned OpenACC worker loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
     for (y = 0; y < 10; y++)
-#pragma acc loop auto vector /* { dg-error ".auto. conflicts with other OpenACC loop specifiers" } */
+#pragma acc loop auto vector /* { dg-optimized "assigned OpenACC vector loop parallelism" } */
+  /* { dg-bogus ".auto. conflicts with other OpenACC loop specifiers" "" { xfail *-*-* } .-1 } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc kernels
-#pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
-#pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
       ;

 #pragma acc kernels
-#pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc kernels
-#pragma acc loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc kernels
-#pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop
+#pragma acc loop /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc kernels
-#pragma acc loop auto
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop
+#pragma acc loop /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

 #pragma acc kernels
-#pragma acc loop
-  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .parloops. for analysis" "" { target *-*-* } .-1 } */
+#pragma acc loop /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
+  /* { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
-#pragma acc loop auto
+#pragma acc loop auto /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
-#pragma acc loop
+#pragma acc loop /* { dg-optimized "assigned OpenACC seq loop parallelism" } */
       for (z = 0; z < 10; z++)
        ;

diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loop-independent_seq.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loop-independent_seq.c
index bbdcf1636b10..f0ac62e5d55f 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loop-independent_seq.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loop-independent_seq.c
@@ -2,7 +2,7 @@
    constructs containing 'loop' constructs with 'independent' or 'seq'
    clauses.  */

-/* { dg-additional-options "-fopt-info-note-optimized-omp" } */
+/* { dg-additional-options "-fopt-info-optimized-omp" } */

 //TODO update accordingly
 /* See also "../../gfortran.dg/goacc/note-parallelism.f90".  */
@@ -14,55 +14,46 @@ main ()

 #pragma acc kernels
 #pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent gang /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent worker /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent vector /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent gang vector /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent gang worker /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent worker vector /* { dg-message "optimized: assigned OpenACC worker vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent gang worker vector /* { dg-message "optimized: assigned OpenACC gang worker vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent gang /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent worker /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -72,13 +63,11 @@ main ()

 #pragma acc kernels
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
     ;

 #pragma acc kernels
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -86,7 +75,6 @@ main ()

 #pragma acc kernels
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -96,7 +84,6 @@ main ()

 #pragma acc kernels
 #pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -106,7 +93,6 @@ main ()

 #pragma acc kernels
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -116,7 +102,6 @@ main ()

 #pragma acc kernels
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang worker loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
   for (x = 0; x < 10; x++)
 #pragma acc loop independent /* { dg-message "optimized: assigned OpenACC vector loop parallelism" } */
     for (y = 0; y < 10; y++)
@@ -124,15 +109,5 @@ main ()
       for (z = 0; z < 10; z++)
        ;

-#pragma acc kernels
-#pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  /* { dg-message "note: parallelized loop nest in OpenACC .kernels. region" "" { target *-*-* } .-1 } */
-  for (x = 0; x < 10; x++)
-#pragma acc loop independent /* { dg-message "optimized: assigned OpenACC gang vector loop parallelism" } */
-    for (y = 0; y < 10; y++)
-#pragma acc loop seq /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-      for (z = 0; z < 10; z++)
-       ;
-
   return 0;
 }
diff --git a/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loops.c b/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loops.c
index 92accdf27fa2..30706a7e4a5e 100644
--- a/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loops.c
+++ b/gcc/testsuite/c-c++-common/goacc/note-parallelism-kernels-loops.c
@@ -1,8 +1,9 @@
 /* Test the output of "-fopt-info-optimized-omp" for an OpenACC 'kernels'
    construct containing loops.  */

-/* { dg-additional-options "-fno-openacc-kernels-annotate-loops" } */
-/* { dg-additional-options "-fopt-info-note-optimized-omp" } */
+/* { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
+   Normally, loop variables would get (implicit) 'private' clauses on the (implicit) 'loop' directives, but given '-fno-openacc-kernels-annotate-loops' they're (implicit) 'copy' -- which we then see get optimized.  */
+/* { dg-additional-options "-fopt-info-optimized-note-omp" } */

 //TODO update accordingly
 /* See also "../../gfortran.dg/goacc/note-parallelism.f90".  */
@@ -12,31 +13,31 @@ main ()
 {
   int x, y, z;

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. region in OpenACC .kernels. construct" } */
+#pragma acc kernels
+  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
     ;

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. region in OpenACC .kernels. construct" } */
+#pragma acc kernels
+  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
     ;

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. region in OpenACC .kernels. construct" } */
+#pragma acc kernels
+  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
     for (y = 0; y < 10; y++)
       for (z = 0; z < 10; z++)
        ;

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. region in OpenACC .kernels. construct" } */
+#pragma acc kernels
+  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
     ;

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. region in OpenACC .kernels. construct" } */
+#pragma acc kernels
+  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
     for (y = 0; y < 10; y++)
       ;

-#pragma acc kernels /* { dg-message "optimized: assigned OpenACC seq loop parallelism" } */
-  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. region in OpenACC .kernels. construct" } */
+#pragma acc kernels
+  for (x = 0; x < 10; x++) /* { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" } */
     for (y = 0; y < 10; y++)
       for (z = 0; z < 10; z++)
        ;
diff --git a/gcc/testsuite/c-c++-common/goacc/routine-1.c b/gcc/testsuite/c-c++-common/goacc/routine-1.c
index a11e602db363..9b65c6c4a00b 100644
--- a/gcc/testsuite/c-c++-common/goacc/routine-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/routine-1.c
@@ -34,7 +34,7 @@ void nohost (void)

 int main ()
 {
-#pragma acc kernels num_gangs (32) num_workers (32) vector_length (32) /* { dg-warning "region contains gang partitioned code but is not gang partitioned" } */
+#pragma acc kernels num_gangs (32) num_workers (32) vector_length (32)
   {
     gang ();
     worker ();
diff --git a/gcc/testsuite/c-c++-common/goacc/routine-level-of-parallelism-2.c b/gcc/testsuite/c-c++-common/goacc/routine-level-of-parallelism-2.c
index 0e0e4a728f05..33678fe8d0a9 100644
--- a/gcc/testsuite/c-c++-common/goacc/routine-level-of-parallelism-2.c
+++ b/gcc/testsuite/c-c++-common/goacc/routine-level-of-parallelism-2.c
@@ -11,8 +11,6 @@
    { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+1 } */
 void g_1 (void)
 {
-  /* { dg-bogus "region is worker partitioned but does not contain worker partitioned code" "" { xfail *-*-* } .-2 } */
-  /* { dg-bogus "region is vector partitioned but does not contain vector partitioned code" "" { xfail *-*-* } .-3 } */
 }
 #pragma acc routine (g_1) gang
 #pragma acc routine (g_1) gang
diff --git a/gcc/testsuite/c-c++-common/goacc/routine-nohost-1.c b/gcc/testsuite/c-c++-common/goacc/routine-nohost-1.c
index 480c57feb05f..bf3c1f3c7cbf 100644
--- a/gcc/testsuite/c-c++-common/goacc/routine-nohost-1.c
+++ b/gcc/testsuite/c-c++-common/goacc/routine-nohost-1.c
@@ -1,7 +1,7 @@
 /* Test the nohost clause for OpenACC routine directive.  Exercising different
    variants for declaring routines.  */

-/* { dg-additional-options "-fdump-tree-oaccloops" } */
+/* { dg-additional-options "-fdump-tree-oaccloops3" } */

 #pragma acc routine nohost
 int THREE(void)
diff --git a/gcc/testsuite/c-c++-common/goacc/uninit-copy-clause.c b/gcc/testsuite/c-c++-common/goacc/uninit-copy-clause.c
index 628b84940a1c..b3cc4459328f 100644
--- a/gcc/testsuite/c-c++-common/goacc/uninit-copy-clause.c
+++ b/gcc/testsuite/c-c++-common/goacc/uninit-copy-clause.c
@@ -7,12 +7,6 @@ foo (void)
   int i;

 #pragma acc kernels
-  /* { dg-warning "'i' is used uninitialized in this function" "" { target *-*-* } .-1 } */
-  /*TODO With the 'copy' -> 'firstprivate' optimization, the original implicit 'copy(i)' clause gets optimized into a 'firstprivate(i)' clause -- and the expected (?) warning diagnostic appears.
-    Have to read up the history behind these test cases.
-    Should this test remain here in this file even if now testing 'firstprivate'?
-    Or, should the optimization be disabled for such testing?
-    Or, the testing be duplicated for both variants?  */
   {
     i = 1;
   }
diff --git a/gcc/testsuite/gcc.dg/goacc/loop-processing-1.c b/gcc/testsuite/gcc.dg/goacc/loop-processing-1.c
index 6979cce71b05..d2245a8f70ce 100644
--- a/gcc/testsuite/gcc.dg/goacc/loop-processing-1.c
+++ b/gcc/testsuite/gcc.dg/goacc/loop-processing-1.c
@@ -1,4 +1,4 @@
-/* { dg-additional-options "-O2 -fdump-tree-oaccdevlow*" } */
+/* { dg-additional-options "-O2 -fdump-tree-oaccdevlow1" } */

 extern int place ();

diff --git a/gcc/testsuite/gcc.dg/goacc/nested-function-1.c b/gcc/testsuite/gcc.dg/goacc/nested-function-1.c
index e17c0e2227fc..6b94692ced7b 100644
--- a/gcc/testsuite/gcc.dg/goacc/nested-function-1.c
+++ b/gcc/testsuite/gcc.dg/goacc/nested-function-1.c
@@ -2,6 +2,7 @@
 /* See gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90 for the Fortran
    version.  */

+/* { dg-excess-errors ".*insufficient partitioning.*" } */
 int main ()
 {
 #define N 100
@@ -35,7 +36,7 @@ int main ()
 #pragma acc loop seq tile(*)
        for (local_j = 0; local_j < N; ++local_j)
          ;
-#pragma acc loop auto independent tile(1)
+#pragma acc loop auto tile(1)
        for (local_j = 0; local_j < N; ++local_j)
          ;
       }
diff --git a/gcc/testsuite/gfortran.dg/goacc/classify-kernels-unparallelized.f95 b/gcc/testsuite/gfortran.dg/goacc/classify-kernels-unparallelized.f95
index 7abf12f3d58d..b41b9e88a8be 100644
--- a/gcc/testsuite/gfortran.dg/goacc/classify-kernels-unparallelized.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/classify-kernels-unparallelized.f95
@@ -2,11 +2,10 @@
 ! OpenACC kernels.

 ! { dg-additional-options "-O2" }
-! { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
 ! { dg-additional-options "-fopt-info-note-optimized-omp" }
 ! { dg-additional-options "-fdump-tree-ompexp" }
-! { dg-additional-options "-fdump-tree-parloops1-all" }
-! { dg-additional-options "-fdump-tree-oaccloops" }
+! { dg-additional-options "-fdump-tree-graphite-all-details" }
+! { dg-additional-options "-fdump-tree-oaccloops1-details" }

 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
 ! aspects of that functionality.
@@ -17,30 +16,23 @@ program main
   integer, dimension (0:n-1) :: a, b, c
   integer :: i

-  ! An "external" mapping of loop iterations/array indices makes the loop
-  ! unparallelizable.
+  ! A function call in a data-reference makes the loop unparallelizable
   integer, external :: f

   call setup(a, b)

-  !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }
-  do i = 0, n - 1 ! { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" }
+  !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))
+  do i = 0, n - 1 ! { dg-message "note: beginning .Graphite. part in OpenACC .kernels. region" }
      c(i) = a(f (i)) + b(f (i))
   end do
   !$acc end kernels
 end program main

 ! Check the offloaded function's attributes.
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint\\)\\)" 1 "ompexp" } }
-
-! Check that exactly one OpenACC kernels construct is analyzed, and that it
-! can't be parallelized.
-! { dg-final { scan-tree-dump-times "FAILED:" 1 "parloops1" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "parloops1" } }
-! { dg-final { scan-tree-dump-not "SUCCESS: may be parallelized" "parloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc parallel_kernels_graphite, omp target entrypoint\\)\\)" 1 "ompexp" } }

 ! Check the offloaded function's classification and compute dimensions (will
 ! always be 1 x 1 x 1 for non-offloading compilation).
-! { dg-final { scan-tree-dump-times "(?n)Function is unparallelized OpenACC kernels offload" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels, omp target entrypoint\\)\\)" 1 "oaccloops" } }
+! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-not "^assigned OpenACC.*?loop parallelism$" "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc parallel_kernels_graphite, omp target entrypoint\\)\\)" 1 "oaccloops1" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/classify-kernels.f95 b/gcc/testsuite/gfortran.dg/goacc/classify-kernels.f95
index fb19a98d8a59..467e3ffb4b64 100644
--- a/gcc/testsuite/gfortran.dg/goacc/classify-kernels.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/classify-kernels.f95
@@ -2,11 +2,8 @@
 ! kernels.

 ! { dg-additional-options "-O2" }
-! { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
-! { dg-additional-options "-fopt-info-note-optimized-omp" }
-! { dg-additional-options "-fdump-tree-ompexp" }
-! { dg-additional-options "-fdump-tree-parloops1-all" }
-! { dg-additional-options "-fdump-tree-oaccloops" }
+! { dg-additional-options "-fopt-info-optimized" }
+! { dg-additional-options "-fdump-tree-oaccloops1" }

 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
 ! aspects of that functionality.
@@ -19,24 +16,15 @@ program main

   call setup(a, b)

-  !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))  ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
-  do i = 0, n - 1 ! { dg-message "note: beginning .parloops. part in OpenACC .kernels. region" }
+  !$acc kernels copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1))
+  do i = 0, n - 1 ! { dg-optimized "assigned OpenACC gang vector loop parallelism" }
      c(i) = a(i) + b(i)
   end do
   !$acc end kernels
 end program main

-! Check the offloaded function's attributes.
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels, omp target entrypoint\\)\\)" 1 "ompexp" } }
-
-! Check that exactly one OpenACC kernels construct is analyzed, and that it
-! can be parallelized.
-! { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops1" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "parloops1" } }
-! { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } }
-
 ! Check the offloaded function's classification and compute dimensions (will
 ! always be 1 x 1 x 1 for non-offloading compilation).
-! { dg-final { scan-tree-dump-times "(?n)Function is parallelized OpenACC kernels offload" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "oaccloops" } }
+! { dg-final { scan-tree-dump-times "(?n)Function is parallel_kernels_graphite OpenACC kernels offload" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc parallel_kernels_graphite, omp target entrypoint\\)\\)" 1 "oaccloops1" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/classify-parallel.f95 b/gcc/testsuite/gfortran.dg/goacc/classify-parallel.f95
index ce4c08ff219d..347f17dbf131 100644
--- a/gcc/testsuite/gfortran.dg/goacc/classify-parallel.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/classify-parallel.f95
@@ -29,6 +29,6 @@ end program main

 ! Check the offloaded function's classification and compute dimensions (will
 ! always be 1 x 1 x 1 for non-offloading compilation).
-! { dg-final { scan-tree-dump-times "(?n)Function is OpenACC parallel offload" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc parallel, omp target entrypoint\\)\\)" 1 "oaccloops" } }
+! { dg-final { scan-tree-dump-times "(?n)Function is OpenACC parallel offload" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc parallel, omp target entrypoint\\)\\)" 1 "oaccloops1" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/classify-routine.f95 b/gcc/testsuite/gfortran.dg/goacc/classify-routine.f95
index 02c929d31a00..dea566f07750 100644
--- a/gcc/testsuite/gfortran.dg/goacc/classify-routine.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/classify-routine.f95
@@ -4,7 +4,7 @@
 ! { dg-additional-options "-O2" }
 ! { dg-additional-options "-fopt-info-optimized-omp" }
 ! { dg-additional-options "-fdump-tree-ompexp" }
-! { dg-additional-options "-fdump-tree-oaccloops" }
+! { dg-additional-options "-fdump-tree-oaccloops1" }

 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
 ! aspects of that functionality.
@@ -28,6 +28,6 @@ end subroutine ROUTINE

 ! Check the offloaded function's classification and compute dimensions (will
 ! always be 1 x 1 x 1 for non-offloading compilation).
-! { dg-final { scan-tree-dump-times "(?n)Function is OpenACC routine level 1" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(0 1, 1 1, 1 1\\), omp declare target \\(worker\\)\\)\\)" 1 "oaccloops" } }
+! { dg-final { scan-tree-dump-times "(?n)Function is OpenACC routine level 1" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(0 1, 1 1, 1 1\\), omp declare target \\(worker\\)\\)\\)" 1 "oaccloops1" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95 b/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95
index 946f4a80c012..4ce2d05e308a 100644
--- a/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/classify-serial.f95
@@ -4,7 +4,7 @@
 ! { dg-additional-options "-O2 -w" }
 ! { dg-additional-options "-fopt-info-optimized-omp" }
 ! { dg-additional-options "-fdump-tree-ompexp" }
-! { dg-additional-options "-fdump-tree-oaccloops" }
+! { dg-additional-options "-fdump-tree-oaccloops1" }

 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
 ! aspects of that functionality.
@@ -18,9 +18,6 @@ program main
   call setup(a, b)

   !$acc serial loop copyin (a(0:n-1), b(0:n-1)) copyout (c(0:n-1)) ! { dg-message "optimized: assigned OpenACC gang vector loop parallelism" }
-  ! { dg-bogus "\[Ww\]arning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-1 }
-  ! { dg-bogus "\[Ww\]arning: region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 }
-  ! { dg-bogus "\[Ww\]arning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 }
   do i = 0, n - 1
      c(i) = a(i) + b(i)
   end do
@@ -32,6 +29,6 @@ end program main

 ! Check the offloaded function's classification and compute dimensions (will
 ! always be 1 x 1 x 1 for non-offloading compilation).
-! { dg-final { scan-tree-dump-times "(?n)Function is OpenACC serial offload" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc serial, omp target entrypoint\\)\\)" 1 "oaccloops" } }
+! { dg-final { scan-tree-dump-times "(?n)Function is OpenACC serial offload" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(1, 1, 1\\), oacc serial, omp target entrypoint\\)\\)" 1 "oaccloops1" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/common-block-3.f90 b/gcc/testsuite/gfortran.dg/goacc/common-block-3.f90
index e9f169f95178..025ae0fd1e7b 100644
--- a/gcc/testsuite/gfortran.dg/goacc/common-block-3.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/common-block-3.f90
@@ -27,16 +27,16 @@ program main
   !$acc end kernels
 end program main

-! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:a \\\[len: 400\\\]\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:a \\\[len: 400\\\]\\\)" 1 "omplower" } }
 ! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:b \\\[len: 400\\\]\\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:c \\\[len: 4\\\]\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_parallel .*map\\(tofrom:c \\\[len: 4\\\]\\\)" 1 "omplower" } }

-! { dg-final { scan-tree-dump-times "omp target oacc_data_kernels .*map\\(tofrom:x \\\[len: 400\\\]\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_data_kernels .*map\\(tofrom:x \\\[len: 400\\\]\\\)" 1 "omplower" } }
 ! { dg-final { scan-tree-dump-times "omp target oacc_data_kernels .*map\\(tofrom:y \\\[len: 400\\\]\\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_present:x \\\[len: 400\\\]\\\[implicit\\\]\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_present:y \\\[len: 400\\\]\\\[implicit\\\]\\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_tofrom:i \\\[len: 4\\\]\\\[implicit\\\]\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "omp target oacc_kernels .*map\\(force_tofrom:c \\\[len: 4\\\]\\\[implicit\\\]\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_parallel_kernels_graphite .*map\\(force_present:x \\\[len: 400\\\]\\\[implicit\\\]\\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_parallel_kernels_graphite .*map\\(force_present:y \\\[len: 400\\\]\\\[implicit\\\]\\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_parallel_kernels_graphite .*private\\(i\\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "omp target oacc_parallel_kernels_graphite .*map\\(force_tofrom:c \\\[len: 4\\\]\\\[implicit\\\]\\\)" 1 "omplower" } }

 ! Expecting no mapping of un-referenced common-blocks variables

diff --git a/gcc/testsuite/gfortran.dg/goacc/gang-static.f95 b/gcc/testsuite/gfortran.dg/goacc/gang-static.f95
index cc83c7dd65b9..37c3222d4081 100644
--- a/gcc/testsuite/gfortran.dg/goacc/gang-static.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/gang-static.f95
@@ -17,7 +17,7 @@ program main

   call test (a, b, 0, n)

-  !$acc parallel loop gang (static:1) num_gangs (10)
+  !$acc parallel loop gang (static:1) num_gangs (11)
   do i = 1, n
      a(i) = b(i) + 1
   end do
@@ -25,7 +25,7 @@ program main

   call test (a, b, 1, n)

-  !$acc parallel loop gang (static:2) num_gangs (10)
+  !$acc parallel loop gang (static:2) num_gangs (12)
   do i = 1, n
      a(i) = b(i) + 2
   end do
@@ -33,7 +33,7 @@ program main

   call test (a, b, 2, n)

-  !$acc parallel loop gang (static:5) num_gangs (10)
+  !$acc parallel loop gang (static:5) num_gangs (13)
   do i = 1, n
      a(i) = b(i) + 5
   end do
@@ -41,7 +41,7 @@ program main

   call test (a, b, 5, n)

-  !$acc parallel loop gang (static:20) num_gangs (10)
+  !$acc parallel loop gang (static:20) num_gangs (14)
   do i = 1, n
      a(i) = b(i) + 20
   end do
@@ -73,10 +73,8 @@ subroutine test (a, b, sarg, n)
   end do
 end subroutine test

-! { dg-final { scan-tree-dump-times "gang\\(static:\\\*\\)" 1 "omplower" } }
 ! { dg-final { scan-tree-dump-times "gang\\(static:1\\)" 1 "omplower" } }
 ! { dg-final { scan-tree-dump-times "gang\\(static:2\\)" 1 "omplower" } }
 ! { dg-final { scan-tree-dump-times "gang\\(static:5\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "gang\\(static:20\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "gang\\(num: 5 static:\\\*\\)" 1 "omplower" } }
-! { dg-final { scan-tree-dump-times "gang\\(num: 30 static:20\\)" 1 "omplower" } }
+! { dg-final { scan-tree-dump-times "gang\\(static:20\\)" 2 "omplower" } }
+! { dg-final { scan-tree-dump-times "gang\\(static:\\\*\\)" 2 "omplower" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-1.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-1.f95
index ddaf7f8e43d4..a70f5efdd6ba 100644
--- a/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-1.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-1.f95
@@ -1,92 +1,161 @@
 ! Test OpenACC 'kernels' construct decomposition.

-! { dg-additional-options "-fopt-info-omp-all" }
-! { dg-additional-options "-fdump-tree-gimple" }
-! { dg-additional-options "--param=openacc-kernels=decompose" }
-! { dg-additional-options "-fdump-tree-omp_oacc_kernels_decompose" }
-
+! { dg-additional-options "-fopt-info-optimized-note-omp" }
+! { dg-additional-options "-O2" } for "Graphite".
+! { dg-additional-options "-fdump-tree-omp_oacc_kernels_decompose-details -fdump-tree-gimple-details" }
 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
 ! aspects of that functionality.

-! See also '../../c-c++-common/goacc/kernels-decompose-1.c'.
-
-! It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
-! passed to 'incr' may be unset, and in that case, it will be set to [...]",
-! so to maintain compatibility with earlier Tcl releases, we manually
-! initialize counter variables:
-! { dg-line l_dummy[variable c_loop_i 0] }
-! { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
-! "WARNING: dg-line var l_dummy defined, but not used".
-
 program main
   implicit none
-  integer, parameter         :: N = 1024
-  integer, dimension (1:N)   :: a
-  integer                    :: i, sum

-  !$acc kernels copyin(a(1:N)) copy(sum)
-  ! { dg-bogus "optimized: assigned OpenACC seq loop parallelism" "TODO" { xfail *-*-* } .-1 }
-  !TODO Is this maybe the report that belongs to the XFAILed report further down?  */
+  integer, external :: f_g
+  !$acc routine (f_g) gang
+  integer, external :: f_w
+  !$acc routine (f_w) worker
+  integer, external :: f_v
+  !$acc routine (f_v) vector
+  integer, external :: f_s
+  !$acc routine (f_s) seq
+
+  integer :: i, j, k
+  integer :: x, y, z
+  logical :: y_l
+  integer, parameter :: N = 10
+  integer :: a(N), b(N), c(N)
+  integer :: sum
+
+  !$acc kernels
+  ! { dg-optimized {'map\(force_tofrom:x \[len: [0-9]+\]\[implicit\]\)' optimized to 'map\(to:x \[len: [0-9]+\]\[implicit\]\)'} "" { target *-*-* } .-1 }
+  ! { dg-optimized {'map\(to:x \[len: [0-9]+\]\[implicit\]\)' further optimized to 'private\(x\)'} "" { target *-*-* } .-2 }
+  ! { dg-optimized {'map\(force_tofrom:y_l \[len: [0-9]+\]\[implicit\]\)' optimized to 'map\(to:y_l \[len: [0-9]+\]\[implicit\]\)'} "" { target *-*-* } .-3 }
+  ! { dg-optimized {'map\(to:y_l \[len: [0-9]+\]\[implicit\]\)' further optimized to 'private\(y_l\)'} "" { target *-*-* } .-4 }
+  x = 0
+  y = 0
+  y_l = x < 10
+  z = x
+  x = x + 1
+  ;
+  !$acc end kernels
+
+  !$acc kernels
+  do i = 1, N ! { dg-optimized "assigned OpenACC gang vector loop parallelism" }
+     a(i) = 0
+  end do
+  !$acc end kernels

-  !$acc loop ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
-  ! { dg-optimized "assigned OpenACC seq loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
+  !$acc kernels loop
+  ! { dg-bogus "assigned OpenACC seq loop parallelism" "TODO-kernels Graphite cannot represent access function" { xfail *-*-* } .-1 }
+  ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "TODO-kernels Graphite cannot represent access function " { xfail *-*-* } .-2 }
+  ! { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-3 }
   do i = 1, N
-    sum = sum + a(i)
+     b(i) = a(N - i + 1)
   end do

-  sum = sum + 1 ! { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" }
-  a(1) = a(1) + 1
+  !$acc kernels ! { dg-optimized {.map\(force_tofrom:sum \[len: [0-9]+\]\[implicit\]\). optimized to .map\(to:sum \[len: [0-9]+\]\[implicit\]\).} }
+  !$acc loop
+  ! { dg-bogus "assigned OpenACC seq loop parallelism" "TODO-kernels Graphite cannot represent access function" { xfail *-*-* } .-1 }
+  ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "TODO-kernels Graphite cannot represent access function " { xfail *-*-* } .-2 }
+  ! { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-3 }
+  do i = 1, N
+     b(i) = a(N - i + 1)
+  end do

-  !$acc loop independent ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_i$c_loop_i }
-  ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
+  !$acc loop
+  ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "TODO-kernels Graphite cannot represent access function " { target *-*-* } .-1 }
+  ! { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-2 }
   do i = 1, N
-    sum = sum + a(i)
+     c(i) = a(i) * b(i)
   end do

-  if (sum .gt. 10) then ! { dg-message "note: beginning 'parloops' part in OpenACC 'kernels' region" }
-    !$acc loop ! { dg-line l_loop_i[incr c_loop_i] }
-    ! { dg-missed "unparallelized loop nest in OpenACC 'kernels' region: it's executed conditionally" "" { target *-*-* } l_loop_i$c_loop_i }
-    !TODO { dg-optimized "assigned OpenACC seq loop parallelism" "TODO" { xfail *-*-* } l_loop_i$c_loop_i }
-    do i = 1, N
-      sum = sum + a(i)
-    end do
-  end if
+  a(z) = 0

-  !$acc loop auto ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
-  ! { dg-optimized "assigned OpenACC seq loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
+  !$acc loop
+  ! { dg-bogus "assigned OpenACC seq loop parallelism" "TODO-kernels missing synth reductions" { xfail *-*-* } .-1 }
+  ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "TODO-kernels missing synth reductions" { xfail *-*-* } .-2 }
+  ! { dg-message "note: forwarded loop nest in OpenACC .kernels. region to .Graphite. for analysis" "" { target *-*-* } .-3 }
   do i = 1, N
     sum = sum + a(i)
   end do

+  !$acc loop seq ! { dg-optimized "assigned OpenACC seq loop parallelism" }
+  do i = 1 + 1, N
+     c(i) = c(i) + c(i - 1)
+  end do
   !$acc end kernels
-end program main

-! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_kernels map\(to:a\[_[0-9]+\] \[len: _[0-9]+\]\) map\(alloc:a \[pointer assign, bias: _[0-9]+\]\) map\(tofrom:sum \[len: [0-9]+\]\)$} 1 "gimple" } }
+  !$acc kernels
+  !$acc loop independent ! { dg-optimized "assigned OpenACC gang loop parallelism" }
+  do i = 1, N
+     !$acc loop independent ! { dg-optimized "assigned OpenACC worker loop parallelism" }
+     do j = 1, N
+        !$acc loop independent ! { dg-optimized "assigned OpenACC seq loop parallelism" }
+        ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+        ! { dg-bogus "optimized: assigned OpenACC vector loop parallelism" "" { target *-*-* } .-2 }
+        do k = 1, N
+           a(1 + mod(i + j + k, N)) &
+                = b(j) &
+                + f_v (c(k)) ! { dg-optimized "assigned OpenACC vector loop parallelism" }
+        end do
+     end do
+  end do
+
+  if (y < 5) then
+     !$acc loop independent ! { dg-optimized "assigned OpenACC gang loop parallelism" }
+     do j = 1, N
+        b(j) = f_w (c(j)) ! { dg-optimized "assigned OpenACC worker vector loop parallelism" }
+     end do
+  end if
+  !$acc end kernels
+
+  !$acc kernels
+  y = f_g (a(5)) ! { dg-optimized "assigned OpenACC gang worker vector loop parallelism" }
+
+  !$acc loop independent ! { dg-optimized "assigned OpenACC gang loop parallelism" }
+  ! { dg-bogus "optimized: assigned OpenACC gang vector loop parallelism" "" { target *-*-* } .-1 }
+  do j = 1, N
+     b(j) = y + f_w (c(j)) ! { dg-optimized "assigned OpenACC worker vector loop parallelism" }
+  end do
+  !$acc end kernels
+
+  !$acc kernels
+  ! { dg-optimized {.map\(force_tofrom:z \[len: [0-9]+\]\[implicit\]\). optimized to .map\(to:z \[len: [0-9]+\]\[implicit\]\).} "" { target *-*-* } .-1 }
+  ! { dg-optimized {.map\(to:z \[len: [0-9]+\]\[implicit\]\). further optimized to .private\(z\).} "" { target *-*-* } .-2 }
+  ! { dg-optimized {.map\(force_tofrom:y \[len: [0-9]+\]\[implicit\]\). optimized to .map\(to:y \[len: [0-9]+\]\[implicit\]\).} "" { target *-*-* } .-3 }
+  ! { dg-optimized {.map\(to:y \[len: [0-9]+\]\[implicit\]\). further optimized to .private\(y\).} "" { target *-*-* } .-4 }
+  y = 3
+
+  !$acc loop independent ! { dg-optimized "assigned OpenACC gang worker loop parallelism" }
+  ! { dg-bogus "optimized: assigned OpenACC gang vector loop parallelism" "" { target *-*-* } .-1 }
+  do j = 1, N
+     b(j) = y + f_v (c(j)) ! { dg-optimized "assigned OpenACC vector loop parallelism" }
+  end do
+
+  z = 2
+  !$acc end kernels
+
+  !$acc kernels
+  !$acc end kernels
+end program main

-! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\)$} 2 "gimple" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\)$} 4 "gimple" } }
 ! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\) independent$} 1 "gimple" } }
-! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\) auto$} 1 "gimple" } }
-! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop} 4 "gimple" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop auto private\(i\)$} 1 "gimple" } }

 ! Check that the OpenACC 'kernels' got decomposed into 'data' and an enclosed
 ! sequence of compute constructs.
-! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_data_kernels map\(to:a\[_[0-9]+\] \[len: _[0-9]+\]\) map\(tofrom:sum \[len: [0-9]+\]\)$} 1 "omp_oacc_kernels_decompose" } }
-! As noted above, we get three "old-style" kernel regions, one gang-single region, and one parallelized loop region.
-! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_kernels async\(-1\) map\(force_present:a\[_[0-9]+\] \[len: _[0-9]+\]\) map\(alloc:a \[pointer assign, bias: _[0-9]+\]\) map\(force_present:sum \[len: [0-9]+\]\)$} 3 "omp_oacc_kernels_decompose" } }
-! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_parallelized async\(-1\) map\(force_present:a\[_[0-9]+\] \[len: _[0-9]+\]\) map\(alloc:a \[pointer assign, bias: _[0-9]+\]\) map\(force_present:sum \[len: [0-9]+\]\)$} 1 "omp_oacc_kernels_decompose" } }
-! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_gang_single async\(-1\) num_gangs\(1\) map\(force_present:a\[_[0-9]+\] \[len: _[0-9]+\]\) map\(alloc:a \[pointer assign, bias: _[0-9]+\]\) map\(force_present:sum \[len: [0-9]+\]\)$} 1 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_data_kernels} 8 "omp_oacc_kernels_decompose" } }
 !
 ! 'data' plus five CCs.
-! { dg-final { scan-tree-dump-times {(?n)#pragma omp target } 6 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_graphite async\(-1\)} 6 "omp_oacc_kernels_decompose" } }

-! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\)$} 2 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop auto private\(i\)$} 5 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\) seq$} 1 "omp_oacc_kernels_decompose" } }
 ! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\) independent$} 1 "omp_oacc_kernels_decompose" } }
-! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(i\) auto} 1 "omp_oacc_kernels_decompose" } }
-! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop} 4 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(j\) independent$} 4 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop private\(k\) independent$} 1 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma acc loop} 12 "omp_oacc_kernels_decompose" } }

 ! Each of the parallel regions is async, and there is a final call to
 ! __builtin_GOACC_wait.
-! { dg-final { scan-tree-dump-times "__builtin_GOACC_wait" 1 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times "__builtin_GOACC_wait" 4 "omp_oacc_kernels_decompose" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95
index c3e00283428b..c86535a9cd83 100644
--- a/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95
@@ -1,9 +1,9 @@
 ! Test OpenACC 'kernels' construct decomposition.

-! { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
+! { dg-additional-options "-fopenacc-kernels-annotate-loops" }
 ! { dg-additional-options "-fopt-info-omp-all" }
 ! { dg-additional-options "--param=openacc-kernels=decompose" }
-! { dg-additional-options "-O2" } for 'parloops'.
+! { dg-additional-options "-O2" } for 'Graphite'.

 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
 ! aspects of that functionality.
@@ -36,71 +36,102 @@ program main
   integer, parameter :: N = 10
   integer :: a(N), b(N), c(N)

-  !$acc kernels
-  x = 0 ! { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" }
+  !$acc kernels ! { dg-line l_kernels[incr region] }
+  ! { dg-missed {.map\(force_tofrom:y \[len: [0-9]+\]\[implicit\]\). not optimized: .y. used} "" { target *-*-* } l_kernels$region }
+  ! { dg-optimized {.map\(force_tofrom:y_l \[len: [0-9]+\]\[implicit\]\). optimized to .map\(to:y_l \[len: [0-9]+\]\[implicit\]\).} "" { target *-*-* } l_kernels$region }
+  ! { dg-optimized {.map\(to:y_l \[len: [0-9]+\]\[implicit\]\). further optimized to .private\(y_l\).}  "" { target *-*-* } l_kernels$region }
+  ! { dg-optimized {.map\(force_tofrom:x \[len: [0-9]+\]\[implicit\]\). optimized to .map\(to:x \[len: [0-9]+\]\[implicit\]\).} "" { target *-*-* } l_kernels$region }
+  ! { dg-optimized {.map\(to:x \[len: [0-9]+\]\[implicit\]\). further optimized to .private\(x\).}  "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {.map\(force_tofrom:z \[len: [0-9]+\]\[implicit\]\). not optimized: .z. used} "" { target *-*-* } l_kernels$region }
+  x = 0
   y = 0
   y_l = x < 10
   z = x
   x = x + 1
+
   ;
   !$acc end kernels

-  !$acc kernels ! { dg-optimized "assigned OpenACC gang loop parallelism" }
-  do i = 1, N ! { dg-message "note: beginning 'parloops' part in OpenACC 'kernels' region" }
+  !$acc kernels ! { dg-line l_kernels[incr region] }
+  ! { dg-missed {'map\(tofrom:a \[len: [0-9]+\]\[implicit\]\)' not optimized: 'a' is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
+  do i = 1, N  ! { dg-line l_loop_i[incr c_loop_i] }
+     ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'Graphite' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
+     ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
      a(i) = 0
   end do
   !$acc end kernels

   !$acc kernels loop ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
-  ! { dg-optimized "assigned OpenACC gang loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-missed {.map\(tofrom:b \[len: [0-9]+\]\[implicit\]\). not optimized: .b. is unsuitable for privatization} "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-missed {.map\(tofrom:a \[len: [0-9]+\]\[implicit\]\). not optimized: .a. is unsuitable for privatization} "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'Graphite' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-optimized "assigned OpenACC gang loop parallelism" "TODO Graphite cannot represent access function" { xfail *-*-* } l_loop_i$c_loop_i }
+  ! { dg-bogus "assigned OpenACC seq loop parallelism" "TODO Graphite cannot represent access function" { xfail *-*-* } l_loop_i$c_loop_i }
+  ! { dg-bogus "missed: .auto. loop has not been analyzed .cf. .graphite. dumps for more information." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_i$c_loop_i }
   do i = 1, N
      b(i) = a(N - i + 1)
   end do

-  !$acc kernels
+  !$acc kernels ! { dg-line l_kernels[incr region] }
+  ! { dg-missed {.map\(force_tofrom:z \[len: [0-9]+\]\[implicit\]\). not optimized: .z. used} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed    {\.\.\. here}  "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {.map\(tofrom:c \[len: [0-9]+\]\[implicit\]\). not optimized: .c. is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {.map\(tofrom:b \[len: [0-9]+\]\[implicit\]\). not optimized: .b. is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {.map\(tofrom:a \[len: [0-9]+\]\[implicit\]\). not optimized: .a. is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
   !$acc loop ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
-  ! { dg-optimized "assigned OpenACC gang loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'Graphite' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-optimized "assigned OpenACC gang loop parallelism" "" { xfail *-*-* } l_loop_i$c_loop_i }
+  ! { dg-bogus "assigned OpenACC seq loop parallelism" "TODO Graphite cannot represent access function" { xfail *-*-* } l_loop_i$c_loop_i }
+  ! { dg-bogus "missed: .auto. loop has not been analyzed .cf. .graphite. dumps for more information." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_i$c_loop_i }
   do i = 1, N
      b(i) = a(N - i + 1)
   end do

   !$acc loop ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
-  ! { dg-optimized "assigned OpenACC gang loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'Graphite' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
   do i = 1, N
      c(i) = a(i) * b(i)
   end do

-  a(z) = 0 ! { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" }
+  a(z) = 0

   !$acc loop ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'parloops' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
-  ! { dg-optimized "assigned OpenACC gang loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-message "note: forwarded loop nest in OpenACC 'kernels' region to 'Graphite' for analysis" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
   do i = 1, N
      c(i) = c(i) + a(i)
   end do

   !$acc loop seq ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_i$c_loop_i }
   ! { dg-optimized "assigned OpenACC seq loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
   do i = 1 + 1, N
      c(i) = c(i) + c(i - 1)
   end do
   !$acc end kernels

-  !$acc kernels ! { dg-optimized "assigned OpenACC worker vector loop parallelism" }
+  !$acc kernels ! { dg-line l_kernels[incr region] }
+  ! { dg-missed {.map\(force_tofrom:y \[len: [0-9]+\]\[implicit\]\). not optimized: .y. used} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed    {\.\.\. here}  "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {.map\(tofrom:c \[len: [0-9]+\]\[implicit\]\). not optimized: .c. is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {.map\(tofrom:b \[len: [0-9]+\]\[implicit\]\). not optimized: .b. is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {.map\(tofrom:a \[len: [0-9]+\]\[implicit\]\). not optimized: .a. is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
+
   !$acc loop independent ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_i$c_loop_i }
   ! { dg-optimized "assigned OpenACC gang loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
+  ! { dg-bogus "missed: .independent. loop in .kernels. region has not been analyzed .cf. .graphite. dumps for more information.." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_i$c_loop_i }
+  ! { dg-bogus "missed: .auto. loop has not been analyzed .cf. .graphite. dumps for more information." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_i$c_loop_i }
   do i = 1, N
      !$acc loop independent ! { dg-line l_loop_j[incr c_loop_j] }
      ! { dg-optimized "assigned OpenACC worker loop parallelism" "" { target *-*-* } l_loop_j$c_loop_j }
+     ! { dg-bogus "missed: .auto. loop has not been analyzed .cf. .graphite. dumps for more information." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_j$c_loop_j }
+     ! { dg-bogus "missed: .independent. loop in .kernels. region has not been analyzed .cf. .graphite. dumps for more information.." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_j$c_loop_j }
      do j = 1, N
         !$acc loop independent ! { dg-line l_loop_k[incr c_loop_k] }
         ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } l_loop_k$c_loop_k }
         ! { dg-optimized "assigned OpenACC seq loop parallelism" "" { target *-*-* } l_loop_k$c_loop_k }
+        ! { dg-bogus "missed: .auto. loop has not been analyzed .cf. .graphite. dumps for more information." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_k$c_loop_k }
+        ! { dg-bogus "missed: .independent. loop in .kernels. region has not been analyzed .cf. .graphite. dumps for more information.." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_k$c_loop_k }
         do k = 1, N
            a(1 + mod(i + j + k, N)) &
                 = b(j) &
@@ -109,45 +140,58 @@ program main
      end do
   end do

-  !TODO Should the following turn into "gang-single" instead of "parloops"?
-  !TODO The problem is that the first STMT is 'if (y <= 4) goto <D.2547>; else goto <D.2548>;', thus "parloops".
-  if (y < 5) then ! { dg-message "note: beginning 'parloops' part in OpenACC 'kernels' region" }
+  if (y < 5) then ! { dg-message "note: beginning 'Graphite' part in OpenACC 'kernels' region" }
      !$acc loop independent ! { dg-line l_loop_j[incr c_loop_j] }
-     ! { dg-missed "unparallelized loop nest in OpenACC 'kernels' region: it's executed conditionally" "" { target *-*-* } l_loop_j$c_loop_j }
+     ! { dg-missed "unparallelized loop nest in OpenACC 'kernels' region: it's executed conditionally" "" { target *-*-* } l_loop_j$c_loop_j } ! TODO-kernels Clarify: should this be unparallelized or should the warning go away?
+     ! { dg-bogus "missed: .auto. loop has not been analyzed .cf. .graphite. dumps for more information." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_j$c_loop_j }
+     ! { dg-bogus "missed: .independent. loop in .kernels. region has not been analyzed .cf. .graphite. dumps for more information.." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_j$c_loop_j }
+     ! { dg-optimized "assigned OpenACC gang loop parallelism" "" { target *-*-* } l_loop_j$c_loop_j }
      do j = 1, N
-        b(j) = f_w (c(j))
+        b(j) = f_w (c(j)) ! { dg-optimized "assigned OpenACC worker vector loop parallelism" }
      end do
   end if
   !$acc end kernels

-  !$acc kernels
-  ! { dg-bogus "\[Ww\]arning: region contains gang partitioned code but is not gang partitioned" "TODO 'kernels'" { xfail *-*-* } .-1 }
+  !$acc kernels ! { dg-line l_kernels[incr region] }
+  ! { dg-missed {'map\(force_tofrom:y \[len: [0-9]+\]\[implicit\]\)' not optimized: 'y' used} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {'map\(tofrom:c \[len: [0-9]+\]\[implicit\]\)' not optimized: 'c' is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {'map\(tofrom:b \[len: [0-9]+\]\[implicit\]\)' not optimized: 'b' is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
+  ! { dg-missed {'map\(tofrom:a \[len: [0-9]+\]\[implicit\]\)' not optimized: 'a' is unsuitable for privatization} "" { target *-*-* } l_kernels$region }
   y = f_g (a(5)) ! { dg-line l_part[incr c_part] }
-  !TODO If such a construct is placed in its own part (like it is, here), can't this actually use gang paralelism, instead of "gang-single"?
-  ! { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" "" { target *-*-* } l_part$c_part }
   ! { dg-optimized "assigned OpenACC gang worker vector loop parallelism" "" { target *-*-* } l_part$c_part }

   !$acc loop independent ! { dg-line l_loop_j[incr c_loop_j] }
-  ! { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_j$c_loop_j }
   ! { dg-optimized "assigned OpenACC gang loop parallelism" "" { target *-*-* } l_loop_j$c_loop_j }
+  ! { dg-bogus "missed: .auto. loop has not been analyzed .cf. .graphite. dumps for more information." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_j$c_loop_j }
+  ! { dg-bogus "missed: .independent. loop in .kernels. region has not been analyzed .cf. .graphite. dumps for more information.." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_j$c_loop_j }
   do j = 1, N
      b(j) = y + f_w (c(j)) ! { dg-optimized "assigned OpenACC worker vector loop parallelism" }
   end do
   !$acc end kernels

-  !$acc kernels
-  y = 3 ! { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" }
+  !$acc kernels ! { dg-line l_kernels[incr region] }
+! { dg-optimized {.map\(force_tofrom:z \[len: [0-9]+\]\[implicit\]\). optimized to .map\(to:z \[len: [0-9]+\]\[implicit\]\).} "" { target *-*-* } l_kernels$region }
+! { dg-optimized {.map\(to:z \[len: [0-9]+\]\[implicit\]\). further optimized to .private\(z\).}  "" { target *-*-* } l_kernels$region }
+! { dg-optimized {.map\(force_tofrom:y \[len: [0-9]+\]\[implicit\]\). optimized to .map\(to:y \[len: [0-9]+\]\[implicit\]\).}  "" { target *-*-* } l_kernels$region }
+! { dg-optimized {.map\(to:y \[len: [0-9]+\]\[implicit\]\). further optimized to .private\(y\).}  "" { target *-*-* } l_kernels$region }
+! { dg-missed    {\.\.\. here}  "" { target *-*-* } l_kernels$region }
+! { dg-missed    {.map\(tofrom:c \[len: [0-9]+\]\[implicit\]\). not optimized: .c. is unsuitable for privatization}  "" { target *-*-* } l_kernels$region }
+! { dg-missed    {.map\(tofrom:b \[len: [0-9]+\]\[implicit\]\). not optimized: .b. is unsuitable for privatization}  "" { target *-*-* } l_kernels$region }
+! { dg-missed    {\.\.\. here}  "" { target *-*-* } l_kernels[expr {$region - 1}] }
+
+  y = 3

   !$acc loop independent ! { dg-line l_loop_j[incr c_loop_j] }
-  ! { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_j$c_loop_j }
   ! { dg-optimized "assigned OpenACC gang worker loop parallelism" "" { target *-*-* } l_loop_j$c_loop_j }
+  ! { dg-bogus "missed: .auto. loop has not been analyzed .cf. .graphite. dumps for more information." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_j$c_loop_j }
+  ! { dg-bogus "missed: .independent. loop in .kernels. region has not been analyzed .cf. .graphite. dumps for more information.." "TODO Inexact representation of access function in Graphite" { xfail *-*-* } l_loop_j$c_loop_j }
   do j = 1, N
      b(j) = y + f_v (c(j)) ! { dg-optimized "assigned OpenACC vector loop parallelism" }
   end do

-  z = 2 ! { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" }
+  z = 2
   !$acc end kernels

-  !$acc kernels ! { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" }
+  !$acc kernels
   !$acc end kernels
 end program main
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-loop-2.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-loop-2.f95
index 3884a81e6fa3..f3ab71da5f80 100644
--- a/gcc/testsuite/gfortran.dg/goacc/kernels-loop-2.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-loop-2.f95
@@ -1,8 +1,7 @@
-! { dg-additional-options "--param=openacc-kernels=parloops" } as this is
-! specifically testing "parloops" handling.
+! { dg-additional-options "--param openacc-kernels=decompose" } as this is
+! specifically testing "Graphite" handling.
 ! { dg-additional-options "-O2" }
-! { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
-! { dg-additional-options "-fdump-tree-parloops1-all" }
+! { dg-additional-options "-fdump-tree-graphite-details" }
 ! { dg-additional-options "-fdump-tree-optimized" }

 program main
@@ -36,9 +35,9 @@ program main
 end program main

 ! Check that only three loops are analyzed, and that all can be parallelized.
-! { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops1" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 3 "parloops1" } }
-! { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } }
+! { dg-final { scan-tree-dump-times "loop has no data-dependences" 6 "graphite" } } ! Two CFG loops per OpenACC loop
+! { dg-final { scan-tree-dump-not "loop has data-dependences" "graphite" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(, , \\), oacc parallel_kernels_graphite, omp target entrypoint\\)\\)" 3 "graphite" } }

 ! Check that the loop has been split off into a function.
 ! { dg-final { scan-tree-dump-times "(?n);; Function MAIN__._omp_fn.0 " 1 "optimized" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-loop-data-2.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-loop-data-2.f95
index 62cd4d38a36c..348a2e186d87 100644
--- a/gcc/testsuite/gfortran.dg/goacc/kernels-loop-data-2.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-loop-data-2.f95
@@ -1,8 +1,7 @@
-! { dg-additional-options "--param=openacc-kernels=parloops" } as this is
-! specifically testing "parloops" handling.
+! { dg-additional-options "--param=openacc-kernels=decompose" } as this is
+! specifically testing "Graphite" handling.
 ! { dg-additional-options "-O2" }
-! { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
-! { dg-additional-options "-fdump-tree-parloops1-all" }
+! { dg-additional-options "-fdump-tree-graphite-details" }
 ! { dg-additional-options "-fdump-tree-optimized" }

 program main
@@ -42,9 +41,9 @@ program main
 end program main

 ! Check that only three loops are analyzed, and that all can be parallelized.
-! { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 3 "parloops1" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 3 "parloops1" } }
-! { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } }
+
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(, , \\), oacc parallel_kernels_graphite, omp target entrypoint\\)\\)" 3 "graphite" } }
+! { dg-final { scan-tree-dump-times "loop has no data-dependences" 6 "graphite" } } ! Two CFG loops per OpenACC loop

 ! Check that the loop has been split off into a function.
 ! { dg-final { scan-tree-dump-times "(?n);; Function MAIN__._omp_fn.0 " 1 "optimized" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-loop-inner.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-loop-inner.f95
index 23e64d29ab3e..0c26c9897c0e 100644
--- a/gcc/testsuite/gfortran.dg/goacc/kernels-loop-inner.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-loop-inner.f95
@@ -1,4 +1,4 @@
-! { dg-additional-options "--param=openacc-kernels=parloops" } as this is
+! { dg-additional-options "--param openacc-kernels=decompose-parloops" } as this is
 ! specifically testing "parloops" handling.
 ! { dg-additional-options "-O2" }
 ! { dg-additional-options "-fopt-info-optimized-omp" }
@@ -9,8 +9,8 @@ program main
    integer :: a(100,100), b(100,100)
    integer :: i, j, d

-   !$acc kernels ! { dg-message "optimized: assigned OpenACC gang loop parallelism" }
-   do i=1,100
+   !$acc kernels
+   do i=1,10 ! { dg-message "optimized: assigned OpenACC seq loop parallelism" }0
      do j=1,100
        a(i,j) = 1
        b(i,j) = 2
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-loop.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-loop.f95
index 2f8db4b9fd7b..7ac3831294f7 100644
--- a/gcc/testsuite/gfortran.dg/goacc/kernels-loop.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-loop.f95
@@ -1,8 +1,7 @@
-! { dg-additional-options "--param=openacc-kernels=parloops" } as this is
-! specifically testing "parloops" handling.
+! { dg-additional-options "--param openacc-kernels=decompose" } as this is
+! specifically testing "Graphite" handling.
 ! { dg-additional-options "-O2" }
-! { dg-additional-options "-fno-openacc-kernels-annotate-loops" }
-! { dg-additional-options "-fdump-tree-parloops1-all" }
+! { dg-additional-options "-fdump-tree-graphite-details" }
 ! { dg-additional-options "-fdump-tree-optimized" }

 program main
@@ -32,9 +31,8 @@ program main
 end program main

 ! Check that only one loop is analyzed, and that it can be parallelized.
-! { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops1" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc kernels parallelized, oacc function \\(, , \\), oacc kernels, omp target entrypoint\\)\\)" 1 "parloops1" } }
-! { dg-final { scan-tree-dump-not "FAILED:" "parloops1" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(, , \\), oacc parallel_kernels_graphite, omp target entrypoint\\)\\)" 1 "graphite" } }
+! { dg-final { scan-tree-dump-times "loop has no data-dependences" 2 "graphite" } } ! Two CFG loops per OpenACC loop

 ! Check that the loop has been split off into a function.
 ! { dg-final { scan-tree-dump-times "(?n);; Function MAIN__._omp_fn.0 " 1 "optimized" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/kernels-tree.f95 b/gcc/testsuite/gfortran.dg/goacc/kernels-tree.f95
index 688ed0a7dc37..0a76b90d279c 100644
--- a/gcc/testsuite/gfortran.dg/goacc/kernels-tree.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/kernels-tree.f95
@@ -38,4 +38,4 @@ end program test
 ! { dg-final { scan-tree-dump-times "map\\(force_deviceptr:u\\)" 1 "original" } }

 ! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_data_kernels if\((?:D\.|_)[0-9]+\)$} 1 "omp_oacc_kernels_decompose" } }
-! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_gang_single num_gangs\(1\) if\((?:D\.|_)[0-9]+\) async\(-1\)$} 1 "omp_oacc_kernels_decompose" } }
+! { dg-final { scan-tree-dump-times {(?n)#pragma omp target oacc_parallel_kernels_graphite if\((?:D\.|_)[0-9]+\) async\(-1\)$} 1 "omp_oacc_kernels_decompose" } }
diff --git a/gcc/testsuite/gfortran.dg/goacc/loop-2-kernels.f95 b/gcc/testsuite/gfortran.dg/goacc/loop-2-kernels.f95
index a4cf11c806f7..853a4b22e212 100644
--- a/gcc/testsuite/gfortran.dg/goacc/loop-2-kernels.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/loop-2-kernels.f95
@@ -35,7 +35,7 @@ program test
       DO j = 1,10
       ENDDO
     ENDDO
-    !$acc loop seq gang ! { dg-error "'seq' overrides other OpenACC loop specifiers" "TODO" { xfail *-*-* } }
+    !$acc loop seq gang ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
     DO i = 1,10
     ENDDO

@@ -56,11 +56,11 @@ program test
       !$acc loop worker ! { dg-error "inner loop uses same OpenACC parallelism as containing loop" }
       DO j = 1,10
       ENDDO
-      !$acc loop gang ! { dg-error "" "TODO" { xfail *-*-* } }
+      !$acc loop gang ! { dg-error "" }
       DO j = 1,10
       ENDDO
     ENDDO
-    !$acc loop seq worker ! { dg-error "'seq' overrides other OpenACC loop specifiers" "TODO" { xfail *-*-* } }
+    !$acc loop seq worker ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
     DO i = 1,10
     ENDDO
     !$acc loop gang worker
@@ -81,14 +81,14 @@ program test
       !$acc loop vector ! { dg-error "inner loop uses same OpenACC parallelism as containing loop" }
       DO j = 1,10
       ENDDO
-      !$acc loop worker ! { dg-error "" "TODO" { xfail *-*-* } }
+      !$acc loop worker ! { dg-error "" }
       DO j = 1,10
       ENDDO
-      !$acc loop gang ! { dg-error "" "TODO" { xfail *-*-* } }
+      !$acc loop gang ! { dg-error "" }
       DO j = 1,10
       ENDDO
     ENDDO
-    !$acc loop seq vector ! { dg-error "'seq' overrides other OpenACC loop specifiers" "TODO" { xfail *-*-* } }
+    !$acc loop seq vector ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
     DO i = 1,10
     ENDDO
     !$acc loop gang vector
@@ -101,7 +101,7 @@ program test
     !$acc loop auto
     DO i = 1,10
     ENDDO
-    !$acc loop seq auto ! { dg-error "'seq' overrides other OpenACC loop specifiers" "TODO" { xfail *-*-* } }
+    !$acc loop seq auto ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
     DO i = 1,10
     ENDDO
     !$acc loop gang auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
@@ -133,7 +133,7 @@ program test
   !$acc kernels loop gang(static:*)
   DO i = 1,10
   ENDDO
-  !$acc kernels loop seq gang ! { dg-error "'seq' overrides other OpenACC loop specifiers" "TODO" { xfail *-*-* } }
+  !$acc kernels loop seq gang ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
   DO i = 1,10
   ENDDO

@@ -146,7 +146,7 @@ program test
   !$acc kernels loop worker(num:5)
   DO i = 1,10
   ENDDO
-  !$acc kernels loop seq worker ! { dg-error "'seq' overrides other OpenACC loop specifiers" "TODO" { xfail *-*-* } }
+  !$acc kernels loop seq worker ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
   DO i = 1,10
   ENDDO
   !$acc kernels loop gang worker
@@ -162,7 +162,7 @@ program test
   !$acc kernels loop vector(length:5)
   DO i = 1,10
   ENDDO
-  !$acc kernels loop seq vector ! { dg-error "'seq' overrides other OpenACC loop specifiers" "TODO" { xfail *-*-* } }
+  !$acc kernels loop seq vector ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
   DO i = 1,10
   ENDDO
   !$acc kernels loop gang vector
@@ -175,7 +175,7 @@ program test
   !$acc kernels loop auto
   DO i = 1,10
   ENDDO
-  !$acc kernels loop seq auto ! { dg-error "'seq' overrides other OpenACC loop specifiers" "TODO" { xfail *-*-* } }
+  !$acc kernels loop seq auto ! { dg-error "'seq' overrides other OpenACC loop specifiers" }
   DO i = 1,10
   ENDDO
   !$acc kernels loop gang auto ! { dg-error "'auto' conflicts with other OpenACC loop specifiers" }
diff --git a/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-2.f90 b/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-2.f90
index bba67dcf7cbc..a9e75f2da7da 100644
--- a/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-2.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-2.f90
@@ -23,7 +23,6 @@ subroutine test_loop_nest_depth_1 ()

   !$acc parallel loop auto copy(array1, array2) ! { dg-message "assigned OpenACC gang vector loop parallelism" }
   ! { dg-message "loop has no data-dependences" "" {target *-*-*} .-1 }
-  ! { dg-message ".auto. loop can be parallel" "" {target *-*-*} .-2 }
   do i=1, n
      array2(i) = array1(i) ! { dg-message "loop has no data-dependences" }
   end do
@@ -31,7 +30,6 @@ subroutine test_loop_nest_depth_1 ()

   !$acc parallel loop auto copy(array1, array2) ! { dg-message "assigned OpenACC seq loop parallelism" }
   ! { dg-message "loop has no data-dependences" "" {target *-*-*} .-1 }
-  ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-2 }
   do i=1, n-1
      array1(i+1) = array1(i) + 10 ! { dg-message "loop has data-dependences" }
      array2(i) = array1(i)
diff --git a/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-3.f90 b/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-3.f90
index d635cc5e4fe0..0338c8788669 100644
--- a/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-3.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-3.f90
@@ -24,12 +24,10 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang worker loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        !$acc loop auto
        ! { dg-message "assigned OpenACC vector loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, m
           array (1, i, j) = array(2, i, j) ! { dg-message "loop has no data-dependences" }
        end do
@@ -42,13 +40,11 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang worker loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        array (2, i, n) = array(1, i, n) ! { dg-message "loop has no data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC vector loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, m
           array (1, i, j) = array (2, i,j) ! { dg-message "loop has no data-dependences" }
        end do
@@ -61,13 +57,11 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
     do i=1, n-1
        array (1, i+1, 1) = array (2, i, 1) ! { dg-message "loop has data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC gang vector loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, m
           array (1, i, j) = array (2, i, j) ! { dg-message "loop has no data-dependences" }
        end do
@@ -81,13 +75,11 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang vector loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        array (2, i, n) = array (1, i, n) ! { dg-message "loop has no data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
        do j=1, m-1
           array (1, i, j+1) = array (1, i, j) ! { dg-message "loop has data-dependences" }
        end do
diff --git a/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-4.f90 b/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-4.f90
index 97acecd8807b..3d8fdd37d661 100644
--- a/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-4.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/loop-auto-transfer-4.f90
@@ -23,17 +23,14 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        !$acc loop auto
        ! { dg-message "assigned OpenACC worker loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, n
        !$acc loop auto
        ! { dg-message "assigned OpenACC vector loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
           do k=1, n
              array (1, i, j, k) = array(2, i, j, k) ! { dg-message "loop has no data-dependences" }
           end do
@@ -47,17 +44,14 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang worker loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        !$acc loop auto
        ! { dg-message "assigned OpenACC vector loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, n
        !$acc loop auto
        ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
           do k=1, n-1
              array (1, i, j, k+1) = array(1, i, j, k) ! { dg-message "loop has data-dependences" }
           end do
@@ -98,19 +92,16 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        array (2, i, n, n) = array (1, i, n, n) ! { dg-message "loop has no data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC worker loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, n-1
           array (2, i, j, n) = array (1, i, j, n) ! { dg-message "loop has no data-dependences" }
           !$acc loop auto
           ! { dg-message "assigned OpenACC vector loop parallelism" "" {target *-*-*} .-1 }
           ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-          ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
           do k=1, n-1
              array (2, i, j, k) = array(1, i, j, k) ! { dg-message "loop has no data-dependences" }
           end do
@@ -126,19 +117,16 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang worker loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        array (2, i, n, n) = array (1, i, n, n) ! { dg-message "loop has no data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC vector loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, n-1
           array (2, i, j, n) = array (1, i, j, n) ! { dg-message "loop has no data-dependences" }
           !$acc loop auto
           ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
           ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-          ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
           do k=1, n-1
              array (1, i, j, k+1) = array(1, i, j, k) ! { dg-message "loop has data-dependences" }
           end do
@@ -154,19 +142,16 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang worker loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        array (2, i, n, n) = array (1, i, n, n) ! { dg-message "loop has no data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
        do j=1, n-1
           array (1, i, j+1, n) = array (1, i, j, n) ! { dg-message "loop has data-dependences" }
           !$acc loop auto
           ! { dg-message "assigned OpenACC vector loop parallelism" "" {target *-*-*} .-1 }
           ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-          ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
           do k=1, n-1
              array (2, i, j, k) = array(1, i, j, k) ! { dg-message "loop has no data-dependences" }
           end do
@@ -182,19 +167,16 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC gang vector loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
     do i=1, n
        array (2, i, n, n) = array (1, i, n, n) ! { dg-message "loop has no data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
        do j=1, n-1
           array (1, i, j+1, n) = array (1, i, j, n) ! { dg-message "loop has data-dependences" }
           !$acc loop auto
           ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
           ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-          ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
           do k=1, n-1
              array (1, i, j, k+1) = array(1, i, j, k) ! { dg-message "loop has data-dependences" }
           end do
@@ -210,18 +192,15 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
     do i=1, n - 1
        array (1, i+1, 1, 1) = array (1, i, 1, 1) ! { dg-message "loop has data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC gang worker loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, n
        !$acc loop auto
        ! { dg-message "assigned OpenACC vector loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
           do k=1, n
              array (1, i, j, k) = array(2, i, j, k) ! { dg-message "loop has no data-dependences" }
           end do
@@ -237,18 +216,15 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
     do i=1, n - 1
        array (1, i+1, 1, 1) = array (1, i, 1, 1) ! { dg-message "loop has data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC gang vector loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
        do j=1, n
        !$acc loop auto
        ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
           do k=1, n - 1
              array (1, i, j, k+1) = array(1, i, j, k) ! { dg-message "loop has data-dependences" }
           end do
@@ -264,19 +240,16 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
     do i=1, n - 1
        array (1, i+1, 1, 1) = array (1, i, 1, 1) ! { dg-message "loop has data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
        do j=1, n - 1
           array (1, i, j+1, 1) = array (1, i, j, 1) ! { dg-message "loop has data-dependences" }
           !$acc loop auto
           ! { dg-message "assigned OpenACC gang vector loop parallelism" "" {target *-*-*} .-1 }
           ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-          ! { dg-message "'auto' loop can be parallel" "" {target *-*-*} .-3 }
           do k=1, n
              array (1, i, j, k) = array(2, i, j, k) ! { dg-message "loop has no data-dependences" }
           end do
@@ -291,19 +264,16 @@ contains
     !$acc loop auto
     ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
     ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-    ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
     do i=1, n-1
        array (1, i+1, 1, 1) = array (1, i, 1, 1) ! { dg-message "loop has data-dependences" }
        !$acc loop auto
        ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
        ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-       ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
        do j=1, n-1
           array (1, i, j+1, 1) = array (1, i, j, 1) ! { dg-message "loop has data-dependences" }
           !$acc loop auto
           ! { dg-message "assigned OpenACC seq loop parallelism" "" {target *-*-*} .-1 }
           ! { dg-message "loop has no data-dependences" "OpenACC internal chunking CFG loop can be parallel" {target *-*-*} .-2 }
-          ! { dg-message "'auto' loop cannot be parallel" "" {target *-*-*} .-3 }
           do k=1, n-1
              array (1, i, j, k+1) = array(1, i, j, k) ! { dg-message "loop has data-dependences" }
           end do
diff --git a/gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90 b/gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90
index 005193f30a7c..7d3dacaf9c9f 100644
--- a/gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90
@@ -99,3 +99,5 @@ contains
     !$acc exit data copyout(nonlocal_a) delete(nonlocal_i) finalize
   end subroutine nonlocal
 end program main
+
+! { dg-prune-output ".*insufficient partitioning.*" }
diff --git a/gcc/testsuite/gfortran.dg/goacc/nested-reductions-2-parallel.f90 b/gcc/testsuite/gfortran.dg/goacc/nested-reductions-2-parallel.f90
index 8fa2cabd35fa..688c0b576741 100644
--- a/gcc/testsuite/gfortran.dg/goacc/nested-reductions-2-parallel.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/nested-reductions-2-parallel.f90
@@ -497,3 +497,180 @@ subroutine acc_parallel_loop_reduction ()
     end do
   end do
 end subroutine acc_parallel_loop_reduction
+
+! The same tests as above, but inside a routine construct.
+subroutine acc_routine ()
+  implicit none (type, external)
+  !$acc routine gang
+  integer :: i, j, k, l, sum, diff
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop  ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      do j = 1, 10
+        !$acc loop reduction(+:sum)
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop collapse(2)  ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      do j = 1, 10
+        do k = 1, 10
+          !$acc loop reduction(+:sum)
+          do l = 1, 10
+            sum = 1
+          end do
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop  ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      do j = 1, 10
+        !$acc loop  ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+        ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+        do k = 1, 10
+          !$acc loop reduction(+:sum)
+          do l = 1, 10
+            sum = 1
+          end do
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop reduction(-:sum)  ! { dg-warning "conflicting reduction operations for .sum." }
+      do j = 1, 10
+        !$acc loop reduction(+:sum)  ! { dg-warning "conflicting reduction operations for .sum." }
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop reduction(-:sum)  ! { dg-warning "conflicting reduction operations for .sum." }
+      do j = 1, 10
+        !$acc loop reduction(-:sum)
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop reduction(-:sum)  ! { dg-warning "conflicting reduction operations for .sum." }
+      do j = 1, 10
+        !$acc loop  ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+        ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+        do k = 1, 10
+          !$acc loop reduction(*:sum)  ! { dg-warning "conflicting reduction operations for .sum." }
+          do l = 1, 10
+            sum = 1
+          end do
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop reduction(-:sum)  ! { dg-warning "conflicting reduction operations for .sum." }
+      do j = 1, 10
+        !$acc loop reduction(+:sum)  ! { dg-warning "conflicting reduction operations for .sum." }
+        ! { dg-warning "insufficient partitioning available to parallelize loop" "" { target *-*-* } .-1 }
+        do k = 1, 10
+          !$acc loop reduction(*:sum)  ! { dg-warning "conflicting reduction operations for .sum." }
+          do l = 1, 10
+            sum = 1
+          end do
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum) reduction(-:diff)
+    do i = 1, 10
+      !$acc loop reduction(-:diff)  ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      do j = 1, 10
+        !$acc loop reduction(+:sum)
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+
+      !$acc loop reduction(+:sum)  ! { dg-warning "nested loop in reduction needs reduction clause for .diff." }
+      do j = 1, 10
+        !$acc loop reduction(-:diff)
+        do k = 1, 10
+            diff = 1
+        end do
+      end do
+    end do
+end subroutine acc_routine
+
+subroutine acc_kernels ()
+  integer :: i, j, k, sum, diff
+
+  ! FIXME:  No diagnostics are produced for these loops because reductions
+  ! in kernels regions are not supported yet.
+  !$acc kernels
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      do j = 1, 10
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop
+      do j = 1, 10
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop reduction(-:diff)
+      do j = 1, 10
+        !$acc loop
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop ! { dg-warning "nested loop in reduction needs reduction clause for .sum." }
+      do j = 1, 10
+        !$acc loop reduction(+:sum)
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+    end do
+
+    !$acc loop reduction(+:sum)
+    do i = 1, 10
+      !$acc loop reduction(-:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+      do j = 1, 10
+        !$acc loop reduction(+:sum) ! { dg-warning "conflicting reduction operations for .sum." }
+        do k = 1, 10
+          sum = 1
+        end do
+      end do
+    end do
+  !$acc end kernels
+end subroutine acc_kernels
diff --git a/gcc/testsuite/gfortran.dg/goacc/pr72741.f90 b/gcc/testsuite/gfortran.dg/goacc/pr72741.f90
index b295a4fcc59c..c176f37d3837 100644
--- a/gcc/testsuite/gfortran.dg/goacc/pr72741.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/pr72741.f90
@@ -6,8 +6,8 @@ SUBROUTINE sub_1
   IMPLICIT NONE
   EXTERNAL :: g_1
   !$ACC ROUTINE (g_1) GANG WORKER ! { dg-error "Multiple loop axes" }
-  !$ACC ROUTINE (ABORT) SEQ VECTOR ! { dg-error "Multiple loop axes" "" { xfail *-*-* } }
-! { dg-bogus "invalid function name abort" "" { xfail *-*-* } .-1 }
+  !$ACC ROUTINE (ABORT) SEQ VECTOR ! { dg-error "Multiple loop axes" "" }
+! { dg-bogus "invalid function name abort" }

   CALL v_1
   CALL g_1
@@ -18,8 +18,8 @@ MODULE m_w_1
   IMPLICIT NONE
   EXTERNAL :: w_1
   !$ACC ROUTINE (w_1) WORKER SEQ ! { dg-error "Multiple loop axes" }
-  !$ACC ROUTINE (ABORT) VECTOR GANG ! { dg-error "Multiple loop axes" "" { xfail *-*-* } }
-! { dg-bogus "invalid function name abort" "" { xfail *-*-* } .-1 }
+  !$ACC ROUTINE (ABORT) VECTOR GANG ! { dg-error "Multiple loop axes" }
+! { dg-bogus "invalid function name abort" "" { target *-*-* } .-1 }

 CONTAINS
   SUBROUTINE sub_2
diff --git a/gcc/testsuite/gfortran.dg/goacc/private-explicit-kernels-1.f95 b/gcc/testsuite/gfortran.dg/goacc/private-explicit-kernels-1.f95
index fef512612bd9..ef67c6386ad4 100644
--- a/gcc/testsuite/gfortran.dg/goacc/private-explicit-kernels-1.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/private-explicit-kernels-1.f95
@@ -28,19 +28,16 @@ program test
   integer :: i3_5_s, j3_5_s, k3_5_s

   !$acc kernels ! Explicit "private(i0_1)" clause cannot be specified here.
-  ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 1 "original" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 1 "gimple" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_kernels map\\(force_tofrom:i0_1 \\\[len: \[0-9\]+\\\]\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+  ! The "private" clause gets added in the "omp_data_optimize" pass and is hence
+  ! not there in the "original"
+  ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 0 "original"} }
   do i0_1 = 1, 100
   end do
   !$acc end kernels

   !$acc kernels ! Explicit "private(i0_2, j0_2)" clause cannot be specified here.
-  ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 1 "original" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 1 "original" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 1 "gimple" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 1 "gimple" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_kernels map\\(force_tofrom:j0_2 \\\[len: \[0-9\]+\\\]\\) map\\(force_tofrom:i0_2 \\\[len: \[0-9\]+\\\]\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 0 "original" } }
+  ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 0 "original" } }
   do i0_2 = 1, 100
      do j0_2 = 1, 100
      end do
diff --git a/gcc/testsuite/gfortran.dg/goacc/private-predetermined-kernels-1.f95 b/gcc/testsuite/gfortran.dg/goacc/private-predetermined-kernels-1.f95
index 38459cfadf33..7446ea116ee5 100644
--- a/gcc/testsuite/gfortran.dg/goacc/private-predetermined-kernels-1.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/private-predetermined-kernels-1.f95
@@ -28,19 +28,19 @@ program test
   integer :: i3_5_s, j3_5_s, k3_5_s

   !$acc kernels
-  ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 1 "original" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 1 "gimple" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_kernels map\\(force_tofrom:i0_1 \\\[len: \[0-9\]+\\\]\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 0 "original" { target *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "private\\(i0_1\\)" 1 "gimple" { target *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_kernels map\\(force_tofrom:i0_1 \\\[len: \[0-9\]+\\\]\\)" 0 "gimple" { target *-*-* } } } ! PR90067
   do i0_1 = 1, 100
   end do
   !$acc end kernels

   !$acc kernels
-  ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 1 "original" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 1 "original" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 1 "gimple" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 1 "gimple" { xfail *-*-* } } } ! PR90067
-  ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_kernels map\\(force_tofrom:j0_2 \\\[len: \[0-9\]+\\\]\\) map\\(force_tofrom:i0_2 \\\[len: \[0-9\]+\\\]\\)" 0 "gimple" { xfail *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 0 "original" { target *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 0 "original" { target *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "private\\(i0_2\\)" 1 "gimple" { target *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "private\\(j0_2\\)" 1 "gimple" { target *-*-* } } } ! PR90067
+  ! { dg-final { scan-tree-dump-times "#pragma omp target oacc_kernels map\\(force_tofrom:j0_2 \\\[len: \[0-9\]+\\\]\\) map\\(force_tofrom:i0_2 \\\[len: \[0-9\]+\\\]\\)" 0 "gimple" { target *-*-* } } } ! PR90067
   do i0_2 = 1, 100
      do j0_2 = 1, 100
      end do
diff --git a/gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90 b/gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90
index d773e8046b52..67b1f124a70c 100644
--- a/gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90
@@ -1,6 +1,7 @@
 ! OpenACC 'routine' directives inside a Fortran module.

 ! { dg-additional-options "-fopt-info-optimized-omp" }
+! { dg-additional-options "-O0" }

 ! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
 ! aspects of that functionality.
@@ -56,7 +57,6 @@ contains
   subroutine g_1 ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" }
     implicit none
     !$acc routine gang
-    ! { dg-bogus "\[Ww\]arning: region is worker partitioned but does not contain worker partitioned code" "TODO default 'gang' 'vector'" { xfail *-*-* } .-3 }

     integer :: i

diff --git a/gcc/testsuite/gfortran.dg/goacc/uninit-copy-clause.f95 b/gcc/testsuite/gfortran.dg/goacc/uninit-copy-clause.f95
index 97fbe1268b73..b2aae1df5229 100644
--- a/gcc/testsuite/gfortran.dg/goacc/uninit-copy-clause.f95
+++ b/gcc/testsuite/gfortran.dg/goacc/uninit-copy-clause.f95
@@ -5,8 +5,6 @@ subroutine foo
   integer :: i

   !$acc kernels
-  ! { dg-warning "'i' is used uninitialized in this function" "" { target *-*-* } .-1 }
-  !TODO See discussion in '../../c-c++-common/goacc/uninit-copy-clause.c'.
   i = 1
   !$acc end kernels

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c
index 25d545559b15..45130620e1aa 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/kernels-decompose-1.c
@@ -26,18 +26,17 @@ int main()
   /* { dg-missed {'map\(tofrom:b [^)]+\)' not optimized: 'b' is unsuitable for privatization} "" { target *-*-* } .-1 }
      { dg-missed {'map\(force_tofrom:a [^)]+\)' not optimized: 'a' is unsuitable for privatization} "" { target *-*-* } .-2 } */
   {
-    int c = 234; /* { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" } */
+    int c = 234; /* { dg-message "note: beginning 'Graphite' part in OpenACC 'kernels' region" } */

     /*TODO Hopefully, this is the same issue as '../../../gcc/testsuite/c-c++-common/goacc/kernels-decompose-ice-1.c'.  */
     (volatile int *) &c;

 #pragma acc loop independent gang /* { dg-line l_loop_i[incr c_loop_i] } */
-    /* { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_i$c_loop_i } */
     /* { dg-optimized "assigned OpenACC gang loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i } */
     for (int i = 0; i < N; ++i)
       b[i] = c;

-    a = c; /* { dg-message "note: beginning 'gang-single' part in OpenACC 'kernels' region" } */
+    a = c; /* { dg-message "note: beginning 'Graphite' part in OpenACC 'kernels' region" } */
   }

   for (int i = 0; i < N; ++i)
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c
index 16ec7172c448..b0094f58e89d 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c
@@ -3,7 +3,6 @@

 /* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
    aspects of that functionality.  */
-/* { dg-additional-options "-O2" } for Graphite/"kernels". */


 /* See also '../libgomp.oacc-fortran/parallel-dims.f90'.  */
@@ -108,9 +107,8 @@ int main ()
     int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max;
     gangs_min = workers_min = vectors_min = INT_MAX;
     gangs_max = workers_max = vectors_max = INT_MIN;
-#pragma acc parallel copy (gangs_actual) /* { dg-warning "region contains gang partitioned code but is not gang partitioned" } */ \
-  num_gangs (GANGS) /* { dg-warning "'num_gangs' value must be positive" "" { target c++ } } */
-    /* { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } .-2 } */
+#pragma acc parallel copy (gangs_actual) num_gangs (GANGS) /* { dg-warning "'num_gangs' value must be positive" "" { target c++ } } */
+    /* { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } .-1 } */
     {
       /* We're actually executing with num_gangs (1).  */
       gangs_actual = 1;
@@ -138,8 +136,8 @@ int main ()
     int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max;
     gangs_min = workers_min = vectors_min = INT_MAX;
     gangs_max = workers_max = vectors_max = INT_MIN;
-#pragma acc parallel copy (workers_actual) /* { dg-warning "region contains worker partitioned code but is not worker partitioned" } */ \
-  num_workers (WORKERS) /* { dg-warning "'num_workers' value must be positive" "" { target c++ } } */
+#pragma acc parallel copy (workers_actual) \
+    num_workers (WORKERS) /* { dg-warning "'num_workers' value must be positive" "" { target c++ } } */
     /* { dg-warning "region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 } */
     {
       /* We're actually executing with num_workers (1).  */
@@ -168,10 +166,10 @@ int main ()
     int gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max;
     gangs_min = workers_min = vectors_min = INT_MAX;
     gangs_max = workers_max = vectors_max = INT_MIN;
-#pragma acc parallel copy (vectors_actual) /* { dg-warning "region contains vector partitioned code but is not vector partitioned" } */ \
-  /* { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_selected } 164 } */ \
+#pragma acc parallel copy (vectors_actual) \
   vector_length (VECTORS) /* { dg-warning "'vector_length' value must be positive" "" { target c++ } } */
-    /* { dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target *-*-* } .-2 } */
+    /* { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_selected } .-2 } */
+    /* { dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target *-*-* } .-3 } */
     {
       /* We're actually executing with vector_length (1), just the GCC nvptx
         back end enforces vector_length (32).  */
@@ -217,7 +215,6 @@ int main ()
 #pragma acc parallel copy (gangs_actual) /* { dg-warning "region is gang partitioned but does not contain gang partitioned code" } */ \
   reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max) \
   num_gangs (gangs)
-    /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-3 } */
     {
       if (acc_on_device (acc_device_host))
        {
@@ -577,12 +574,16 @@ int main ()
       asm volatile ("" : : : "memory");

 #pragma acc loop reduction (min: gangs_min, workers_min, vectors_min) reduction (max: gangs_max, workers_max, vectors_max)
+/* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-1 } */
+/* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-2 } */
+/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-3 } */
+/* { dg-warning "removed gang worker vector partitioning from 'kernels' region" "" { target *-*-* } .-4 } */
       for (int i = 100; i > -100; --i)
-       {
-         gangs_min = gangs_max = acc_gang ();
-         workers_min = workers_max = acc_worker ();
-         vectors_min = vectors_max = acc_vector ();
-       }
+        {
+          gangs_min = gangs_max = acc_gang ();
+          workers_min = workers_max = acc_worker ();
+          vectors_min = vectors_max = acc_vector ();
+        }
     }
     if (gangs_min != 0 || gangs_max != 1 - 1
        || workers_min != 0 || workers_max != 1 - 1
@@ -627,6 +628,7 @@ int main ()
     /* { dg-bogus "warning: region contains gang partitioned code but is not gang partitioned" "TODO 'serial'" { xfail *-*-* } .-2 }
        { dg-bogus "warning: region contains worker partitioned code but is not worker partitioned" "TODO 'serial'" { xfail *-*-* } .-3 }
        { dg-bogus "warning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-4 } */
+    /* { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_selected } .-5 } */
     {
       if (acc_on_device (acc_device_nvidia))
        {
@@ -658,7 +660,7 @@ int main ()
        __builtin_abort ();
     if (gangs_min != 0 || gangs_max != 1 - 1
        || workers_min != 0 || workers_max != 1 - 1
-       || vectors_min != 0 || vectors_max != vectors_actual - 1)
+       || vectors_min != 0 || vectors_max >= vectors_actual)
       __builtin_abort ();
   }

diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr84955-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr84955-1.c
index 44767cd27c32..0fbfeb0b6102 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr84955-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr84955-1.c
@@ -28,4 +28,3 @@ f2 (void)

   return i + j;
 }
-/* { dg-final { scan-tree-dump-not "if" "cddce2"} } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-2.c
index 84b9c01443e5..3898b1c55ab7 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-2.c
@@ -15,8 +15,8 @@ main (void)
   return 0;
 }

-/* Todo: Boths bar.syncs can be removed.
-   Atm we generate this dead code inbetween forked and joining:
+/* All bar.syncs can be removed.
+   Previously, we generated dead code inbetween forked and joining:

                      mov.u32 %r28, %ntid.y;
                      mov.u32 %r29, %tid.y;
@@ -31,6 +31,6 @@ main (void)
              @%r33   bra     $L3;
      $L2:

-   so the loop is not recognized as empty loop (which we detect by seeing if
+   so the loop was not recognized as empty loop (which we detect by seeing if
    joining immediately follows forked).  */
-/* { dg-final { scan-offload-rtl-dump-times "nvptx_barsync" 2 "mach" } } */
+/* { dg-final { scan-offload-rtl-dump-times "nvptx_barsync" 0 "mach" } } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-3.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-3.c
index 10a4116676b4..866349797f3c 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-3.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-3.c
@@ -9,7 +9,6 @@ int a;
 #pragma acc declare create(a)

 #pragma acc routine vector
-/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+2 } */
 void __attribute__((noinline, noclone))
 foo_v (void)
 {
@@ -17,8 +16,6 @@ foo_v (void)
 }

 #pragma acc routine worker
-/* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .+3 }
-   { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+2 } */
 void __attribute__((noinline, noclone))
 foo_w (void)
 {
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-4.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-4.c
index e1679444172c..0aeaf7799f68 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-4.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-4.c
@@ -11,11 +11,11 @@ main (void)
   {
     #pragma acc loop worker
     for (int i = 0; i < n; i++)
-      ;
+      asm volatile ("");

     #pragma acc loop worker
     for (int i = 0; i < n; i++)
-      ;
+      asm volatile ("");
   }

   return 0;
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486-2.c
index bc55d158a81f..e5b5c3e84374 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486-2.c
@@ -7,5 +7,5 @@

 #include "pr85486.c"

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)" "oaccdevlow1" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)" "oaccdevlow3" } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=1, vectors=32" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486-3.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486-3.c
index 33480a4ae682..3d0336a61ad6 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486-3.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486-3.c
@@ -7,5 +7,5 @@

 #include "pr85486.c"

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)" "oaccdevlow" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)" "oaccdevlow3" } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=1, vectors=32" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486.c
index 0d98b82f9932..f7d2f3b0fdd4 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85486.c
@@ -54,5 +54,5 @@ main (void)
   return 0;
 }

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)" "oaccdevlow" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)" "oaccdevlow3" } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=1, vectors=32" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-1.c
index 22891a243e14..95946c581b19 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-1.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-1.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target openacc_nvidia_accel_selected } } */
-/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow1" } */
+/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow" } */
 /* { dg-set-target-env-var "GOMP_DEBUG" "1" } */

 #include <stdlib.h>
@@ -34,5 +34,6 @@ main (void)
   return 0;
 }

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 128\\)" "oaccdevlow1" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 128\\)"  "oaccdevlow1" { target { any-opts "-O[123s]"} } } } *
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 128\\)"  "oaccdevlow3" { target { any-opts "-O[0g]"} } } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=1, vectors=128" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-2.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-2.c
index 30418f378f93..cab21013daef 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-2.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-2.c
@@ -1,6 +1,6 @@
 /* { dg-do run { target openacc_nvidia_accel_selected } } */
 /* { dg-additional-options "-fopenacc-dim=::128" } */
-/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow1" } */
+/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow" } */
 /* { dg-set-target-env-var "GOMP_DEBUG" "1" } */

 #include <stdlib.h>
@@ -35,5 +35,6 @@ main (void)
   return 0;
 }

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 128\\)" "oaccdevlow1" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 128\\)"  "oaccdevlow1" { target { any-opts "-O[123s]"} } } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 128\\)"  "oaccdevlow3" { target { any-opts "-O[0g]"} } } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=1, vectors=128" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-3.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-3.c
index 754964d60100..003057415fc6 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-3.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-3.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target openacc_nvidia_accel_selected } } */
-/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow1" } */
+/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow" } */
 /* We default to warp size 32 for the vector length, so the GOMP_OPENACC_DIM has
    no effect.  */
 /* { dg-set-target-env-var "GOMP_OPENACC_DIM" "::128" } */
@@ -38,5 +38,6 @@ main (void)
   return 0;
 }

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)" "oaccdevlow1" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)"  "oaccdevlow1" { target { any-opts "-O[123s]"} } } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 1, 32\\)"  "oaccdevlow3" { target { any-opts "-O[0g]"} } } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=1, vectors=32" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-4.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-4.c
index 44364cbc51a7..b004a9d5072e 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-4.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-4.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target openacc_nvidia_accel_selected } } */
-/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow1" } */
+/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow" } */
 /* { dg-set-target-env-var "GOMP_DEBUG" "1" } */

 #include <stdlib.h>
@@ -36,5 +36,6 @@ main (void)
   return 0;
 }

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 2, 128\\)" "oaccdevlow1" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 2, 128\\)"  "oaccdevlow1" { target { any-opts "-O[123s]"} } } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 2, 128\\)"  "oaccdevlow3" { target { any-opts "-O[0g]"} } } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=2, vectors=128" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-5.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-5.c
index 5e387c6ced61..9e7f9a2d9ed9 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-5.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-5.c
@@ -1,6 +1,6 @@
 /* { dg-do run { target openacc_nvidia_accel_selected } } */
 /* { dg-additional-options "-fopenacc-dim=:2:128" } */
-/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow1" } */
+/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow" } */
 /* { dg-set-target-env-var "GOMP_DEBUG" "1" } */

 #include <stdlib.h>
@@ -37,5 +37,6 @@ main (void)
   return 0;
 }

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 2, 128\\)" "oaccdevlow1" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 2, 128\\)"  "oaccdevlow1" { target { any-opts "-O[123s]"} } } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 2, 128\\)"  "oaccdevlow3" { target { any-opts "-O[0g]"} } } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=2, vectors=128" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-6.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-6.c
index d32f4e4417ab..01b186e91bd7 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-6.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-6.c
@@ -1,6 +1,6 @@
 /* { dg-do run { target openacc_nvidia_accel_selected } } */
 /* { dg-set-target-env-var "GOMP_OPENACC_DIM" ":2:" } */
-/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow1" } */
+/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow" } */
 /* { dg-set-target-env-var "GOMP_DEBUG" "1" } */

 #include <stdlib.h>
@@ -37,5 +37,6 @@ main (void)
   return 0;
 }

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 0, 128\\)" "oaccdevlow1" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 0, 128\\)"  "oaccdevlow1" { target { any-opts "-O[123s]"} } } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 0, 128\\)"  "oaccdevlow3" { target { any-opts "-O[0g]"} } } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=2, vectors=128" } */
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c
index df5cb09df712..8319cb32412e 100644
--- a/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c
+++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/vector-length-128-7.c
@@ -1,5 +1,5 @@
 /* { dg-do run { target openacc_nvidia_accel_selected } } */
-/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow1" } */
+/* { dg-additional-options "-foffload=-fdump-tree-oaccdevlow" } */
 /* { dg-set-target-env-var "GOMP_DEBUG" "1" } */

 #include <stdlib.h>
@@ -36,5 +36,6 @@ main (void)
   return 0;
 }

-/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 0, 128\\)" "oaccdevlow1" } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 0, 128\\)"  "oaccdevlow1" { target { any-opts "-O[123s]"} } } } */
+/* { dg-final { scan-offload-tree-dump "__attribute__\\(\\(oacc function \\(1, 0, 128\\)"  "oaccdevlow3" { target { any-opts "-O[0g]"} } } } */
 /* { dg-output "nvptx_exec: kernel main\\\$_omp_fn\\\$0: launch gangs=1, workers=8, vectors=128" } */
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-1.f90
index 0d5ea73813de..b5b3c53d59dd 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-1.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-1.f90
@@ -2,7 +2,8 @@

 ! { dg-do run }
 ! { dg-additional-options "-fdump-tree-oaccdevlow-details -Wopenacc-parallelism" }
-! { dg-final { scan-tree-dump-times "Decl UID \[0-9\]+ has gang partitioning:  integer\\(kind=4\\) w;" 1 "oaccdevlow" } } */
+! { dg-final { scan-tree-dump-times "Decl UID \[0-9\]+ has gang partitioning:  integer\\(kind=4\\) w;" 1 "oaccdevlow1" { target { any-opts "-O[1,2,3,s]"} } } } */
+! { dg-final { scan-tree-dump-times "Decl UID \[0-9\]+ has gang partitioning:  integer\\(kind=4\\) w;" 1 "oaccdevlow3" { target { no-opts "-O[1,2,3,s]"} } } } */

 program main
   integer :: w, arr(0:31)
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90
index 90e06be24ff5..2a2bc4cc7cf7 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/gangprivate-attrib-2.f90
@@ -2,7 +2,8 @@

 ! { dg-do run }
 ! { dg-additional-options "-fdump-tree-oaccdevlow-details" }
-! { dg-final { scan-tree-dump-times "Decl UID \[0-9\]+ has worker partitioning:  integer\\(kind=4\\) w;" 1 "oaccdevlow" } } */
+! { dg-final { scan-tree-dump-times "Decl UID \[0-9\]+ has worker partitioning:  integer\\(kind=4\\) w;" 1 "oaccdevlow1" { target { any-opts "-O[1,2,3,s]"} } } } */
+! { dg-final { scan-tree-dump-times "Decl UID \[0-9\]+ has worker partitioning:  integer\\(kind=4\\) w;" 1 "oaccdevlow3" { target { no-opts "-O[1,2,3,s]"} } } } */

 program main
   integer :: w, arr(0:31)
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction-2.f90
index 0a612a57964e..a9131a06f77b 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction-2.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/kernels-acc-loop-reduction-2.f90
@@ -1,5 +1,10 @@
 ! { dg-do run }
-!
+! { dg-xfail-run-if "PR102424" { ! openacc_host_selected } }
+! TODO PR102424 OpenACC 'reduction' with outer 'loop seq', inner 'loop gang'
+
+! { dg-additional-options "-O2" }
+! { dg-additional-options "-fopt-info-omp" }
+
 program foo

   IMPLICIT NONE
@@ -17,9 +22,10 @@ subroutine bar(vol)
   INTEGER :: j,k

   !$ACC KERNELS
-  !$ACC LOOP REDUCTION(+:vol)
+  ! TODO The "reduction" dependence handling in Graphite should be adjusted to take the outer "reduction" into account correctly
+  !$ACC LOOP REDUCTION(+:vol) ! { dg-bogus "optimized: assigned OpenACC seq loop parallelism" "TODO Suboptimal parallelism assigned" { xfail *-*-* } }
   DO k=1,2
-     !$ACC LOOP REDUCTION(+:vol)
+     !$ACC LOOP REDUCTION(+:vol) ! { dg-bogus "optimized: assigned OpenACC gang vector loop parallelism" "TODO Suboptimal parallelism assigned" { xfail *-*-* } }
      DO j=1,2
        vol = vol + 1
      ENDDO
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/parallel-loop-auto-reduction-2.f90 b/libgomp/testsuite/libgomp.oacc-fortran/parallel-loop-auto-reduction-2.f90
deleted file mode 100644
index 0e9da426d998..000000000000
--- a/libgomp/testsuite/libgomp.oacc-fortran/parallel-loop-auto-reduction-2.f90
+++ /dev/null
@@ -1,98 +0,0 @@
-! Check that the Graphite-based "auto" loop and "kernels" handling
-! is able to assign the parallelism dimensions correctly for a simple
-! loop-nest with reductions. All loops should be parallelized.
-
-! { dg-additional-options "-O2 -g" }
-! { dg-additional-options "-foffload=-fdump-tree-oaccloops1-details" }
-! { dg-additional-options "-foffload=-fopt-info-optimized" }
-! { dg-additional-options "-fdump-tree-oaccloops1-details" }
-! { dg-additional-options "-fopt-info-optimized" }
-
-module test
-  implicit none
-
-  integer, parameter :: n = 10000
-  integer :: a(n,n)
-  integer :: sums(n,n)
-
-contains
-  function sum_loop_auto() result(sum)
-    integer :: i, j
-    integer :: sum, max_val
-
-    sum = 0
-    max_val = 0
-
-    !$acc parallel copyin (a) reduction(+:sum)
-    !$acc loop auto reduction(+:sum) reduction(max:max_val) ! { dg-optimized "assigned OpenACC gang worker loop parallelism" }
-    ! { dg-optimized ".auto. loop can be parallel" "" { target *-*-* } .-1 }
-    do i = 1,size (a, 1)
-       !$acc loop auto reduction(max:max_val) ! { dg-optimized "assigned OpenACC vector loop parallelism" }
-       ! { dg-optimized ".auto. loop can be parallel" "" { target *-*-* } .-1 }
-       do j = 1,size(a, 2)
-          max_val = a(i,j)
-       end do
-       sum = sum + max_val
-    end do
-    !$acc end parallel
-  end function sum_loop_auto
-
-  function sum_kernels() result(sum)
-    integer :: i, j
-    integer :: sum, max_val
-
-    sum = 0
-    max_val = 0
-
-    !$acc kernels
-    ! { dg-optimized {'map\(force_tofrom:max_val [^)]+\)' optimized to 'map\(to:max_val [^)]+\)'} "" { target *-*-* } .-1 }
-    !$acc loop reduction(+:sum) reduction(max:max_val) ! { dg-optimized "assigned OpenACC gang worker loop parallelism" }
-    ! { dg-optimized ".auto. loop can be parallel" "" { target *-*-* } .-1 }
-    ! { dg-optimized "forwarded loop nest in OpenACC .kernels. construct to .Graphite." "" { target *-*-* } .-2 }
-    do i = 1,size (a, 1)
-       !$acc loop reduction(max:max_val) ! { dg-optimized "assigned OpenACC vector loop parallelism" }
-       ! { dg-optimized ".auto. loop can be parallel" "" { target *-*-* } .-1 }
-       do j = 1,size(a, 2)
-          max_val = a(i,j)
-       end do
-       sum = sum + max_val
-    end do
-    !$acc end kernels
-  end function sum_kernels
-end module test
-
-program main
-  use test
-
-  implicit none
-
-  integer :: result, i, j
-
-  ! We sum the maxima of n rows, each containing numbers
-  ! 1..n
-  integer, parameter :: expected_sum = n * n
-
-  do i = 1, size (a, 1) ! { dg-optimized "loop nest optimized" }
-     do j = 1, size (a, 2)
-        a(i, j) = j
-     end do
-  end do
-
-
-  result = sum_loop_auto()
-  if (result /= expected_sum) then
-     write (*, *) "Wrong result:", result
-     call abort()
-  endif
-
-  result = sum_kernels()
-  if (result /= expected_sum) then
-     write (*, *) "Wrong result:", result
-     call abort()
-  endif
-end program main
-
-! This ensures that the dg-optimized assertions above hold for both
-! compilers because the output goes to stderr and the dump file.
-! { dg-final { scan-offload-tree-dump-times "optimized: assigned OpenACC .*? parallelism" 4 "oaccloops1" } }
-! { dg-final { scan-tree-dump-times "optimized: assigned OpenACC .*? parallelism" 4 "oaccloops1" } }
diff --git a/libgomp/testsuite/libgomp.oacc-fortran/pr94358-1.f90 b/libgomp/testsuite/libgomp.oacc-fortran/pr94358-1.f90
index 994a8a35110f..6ac66e1a088b 100644
--- a/libgomp/testsuite/libgomp.oacc-fortran/pr94358-1.f90
+++ b/libgomp/testsuite/libgomp.oacc-fortran/pr94358-1.f90
@@ -22,13 +22,11 @@ subroutine kernel(lo, hi, a, b, c)
   ! { dg-missed {'map\(tofrom:\*b [^)]+\)' not optimized: '\*b' is unsuitable for privatization} "" { target *-*-* } .-3 }
   ! { dg-missed {'map\(tofrom:\*a [^)]+\)' not optimized: '\*a' is unsuitable for privatization} "" { target *-*-* } .-4 }
   !$acc loop independent ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_i$c_loop_i }
   ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
   do i = lo, hi
      b(i) = a(i)
   end do
   !$acc loop independent ! { dg-line l_loop_i[incr c_loop_i] }
-  ! { dg-message "note: parallelized loop nest in OpenACC 'kernels' region" "" { target *-*-* } l_loop_i$c_loop_i }
   ! { dg-optimized "assigned OpenACC gang vector loop parallelism" "" { target *-*-* } l_loop_i$c_loop_i }
   do i = lo, hi
      c(i) = b(i)
--
2.33.0

-----------------
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


More information about the Gcc-patches mailing list