]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Enhance further testcases to verify handling of OpenACC privatization level [PR90115]
authorThomas Schwinge <thomas@codesourcery.com>
Tue, 8 Mar 2022 10:51:55 +0000 (11:51 +0100)
committerThomas Schwinge <thomas@codesourcery.com>
Thu, 10 Mar 2022 10:24:07 +0000 (11:24 +0100)
As originally introduced in commit 11b8286a83289f5b54e813f14ff56d730c3f3185
"[OpenACC privatization] Largely extend diagnostics and corresponding testsuite
coverage [PR90115]".

PR middle-end/90115
gcc/testsuite/
* c-c++-common/goacc/nesting-1.c: Enhance.
* gcc.dg/goacc/nested-function-1.c: Likewise.
* gcc.dg/goacc/nested-function-2.c: Likewise.
* gfortran.dg/goacc/nested-function-1.f90: Likewise.
libgomp/
* testsuite/libgomp.oacc-fortran/routine-1.f90: Enhance.
* testsuite/libgomp.oacc-fortran/routine-2.f90: Likewise.
* testsuite/libgomp.oacc-fortran/routine-3.f90: Likewise.
* testsuite/libgomp.oacc-fortran/routine-9.f90: Likewise.

gcc/testsuite/c-c++-common/goacc/nesting-1.c
gcc/testsuite/gcc.dg/goacc/nested-function-1.c
gcc/testsuite/gcc.dg/goacc/nested-function-2.c
gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90
libgomp/testsuite/libgomp.oacc-fortran/routine-1.f90
libgomp/testsuite/libgomp.oacc-fortran/routine-2.f90
libgomp/testsuite/libgomp.oacc-fortran/routine-3.f90
libgomp/testsuite/libgomp.oacc-fortran/routine-9.f90

index cab4f98950dec9b92712e30562ac9c03c3c5f497..83cbff767a42b26a20805860c126f072ee55f4fd 100644 (file)
@@ -1,3 +1,15 @@
+/* { dg-additional-options "-fopt-info-all-omp" } */
+
+/* { dg-additional-options "--param=openacc-privatization=noisy" } */
+
+/* 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_compute 0 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".  */
+
 extern int i;
 
 void
@@ -5,7 +17,11 @@ f_acc_parallel (void)
 {
 #pragma acc parallel
   {
-#pragma acc loop
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+    /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+    /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i }
+       { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */
+    /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */
     for (i = 0; i < 2; ++i)
       ;
   }
@@ -15,9 +31,12 @@ f_acc_parallel (void)
 void
 f_acc_kernels (void)
 {
-#pragma acc kernels
+#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */
+  /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */
   {
-#pragma acc loop
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+    /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+    /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } */
     for (i = 0; i < 2; ++i)
       ;
   }
@@ -34,17 +53,25 @@ f_acc_data (void)
 
 #pragma acc parallel
     {
-#pragma acc loop
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+      /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+      /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i }
+        { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */
+      /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */
       for (i = 0; i < 2; ++i)
        ;
     }
 
-#pragma acc kernels
+#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */
+    /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */
     ;
 
-#pragma acc kernels
+#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */
+    /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */
     {
-#pragma acc loop
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+      /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+      /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } */
       for (i = 0; i < 2; ++i)
        ;
     }
@@ -65,17 +92,25 @@ f_acc_data (void)
 
 #pragma acc parallel
       {
-#pragma acc loop
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+       /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+       /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i }
+          { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop_i$c_loop_i } */
+       /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop_i$c_loop_i } */
        for (i = 0; i < 2; ++i)
          ;
       }
 
-#pragma acc kernels
+#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */
+      /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */
       ;
 
-#pragma acc kernels
+#pragma acc kernels /* { dg-line l_compute[incr c_compute] } */
+      /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute$c_compute } */
       {
-#pragma acc loop
+#pragma acc loop /* { dg-line l_loop_i[incr c_loop_i] } */
+       /* { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop_i$c_loop_i } */
+       /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop_i$c_loop_i } */
        for (i = 0; i < 2; ++i)
          ;
       }
index e17c0e2227fc84affe292bfa49be786a4234b94a..c34bcb0d601385f14859e5c84efe50cb91520142 100644 (file)
@@ -2,6 +2,20 @@
 /* See gcc/testsuite/gfortran.dg/goacc/nested-function-1.f90 for the Fortran
    version.  */
 
+/* { dg-additional-options "-fopt-info-all-omp" } */
+
+/* { dg-additional-options "--param=openacc-privatization=noisy" }
+   Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
+   { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} } */
+
+/* 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_compute_loop 0 c_loop 0] }
+   { dg-message dummy {} { target iN-VAl-Id } l_dummy } to avoid
+   "WARNING: dg-line var l_dummy defined, but not used".  */
+
 int main ()
 {
 #define N 100
@@ -25,32 +39,40 @@ int main ()
       local_a[i] = 5;
     local_arg = 5;
 
-#pragma acc kernels loop \
+#pragma acc kernels loop /* { dg-line l_compute_loop[incr c_compute_loop] } */ \
   gang(num:local_arg) worker(local_arg) vector(local_arg) \
   wait async(local_arg)
+    /* { dg-note {variable 'local_i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } */
+    /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } */
     for (local_i = 0; local_i < N; ++local_i)
       {
 #pragma acc cache (local_a[local_i:5])
        local_a[local_i] = 100;
-#pragma acc loop seq tile(*)
+#pragma acc loop seq tile(*) /* { dg-line l_loop[incr c_loop] } */
+       /* { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
        for (local_j = 0; local_j < N; ++local_j)
          ;
-#pragma acc loop auto independent tile(1)
+#pragma acc loop auto independent tile(1) /* { dg-line l_loop[incr c_loop] } */
+       /* { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
        for (local_j = 0; local_j < N; ++local_j)
          ;
       }
 
-#pragma acc kernels loop \
+#pragma acc kernels loop /* { dg-line l_compute_loop[incr c_compute_loop] } */ \
   gang(static:local_arg) worker(local_arg) vector(local_arg) \
   wait(local_arg, local_arg + 1, local_arg + 2) async
+    /* { dg-note {variable 'local_i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } */
+    /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } */
     for (local_i = 0; local_i < N; ++local_i)
       {
 #pragma acc cache (local_a[local_i:4])
        local_a[local_i] = 100;
-#pragma acc loop seq tile(1)
+#pragma acc loop seq tile(1) /* { dg-line l_loop[incr c_loop] } */
+       /* { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
        for (local_j = 0; local_j < N; ++local_j)
          ;
-#pragma acc loop auto independent tile(*)
+#pragma acc loop auto independent tile(*) /* { dg-line l_loop[incr c_loop] } */
+       /* { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
        for (local_j = 0; local_j < N; ++local_j)
          ;
       }
@@ -62,32 +84,40 @@ int main ()
       nonlocal_a[i] = 5;
     nonlocal_arg = 5;
 
-#pragma acc kernels loop \
+#pragma acc kernels loop /* { dg-line l_compute_loop[incr c_compute_loop] } */ \
   gang(num:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) \
   wait async(nonlocal_arg)
+    /* { dg-note {variable 'nonlocal_i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } */
+    /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } */
     for (nonlocal_i = 0; nonlocal_i < N; ++nonlocal_i)
       {
 #pragma acc cache (nonlocal_a[nonlocal_i:3])
        nonlocal_a[nonlocal_i] = 100;
-#pragma acc loop seq tile(2)
+#pragma acc loop seq tile(2) /* { dg-line l_loop[incr c_loop] } */
+       /* { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
        for (nonlocal_j = 0; nonlocal_j < N; ++nonlocal_j)
          ;
-#pragma acc loop auto independent tile(3)
+#pragma acc loop auto independent tile(3) /* { dg-line l_loop[incr c_loop] } */
+       /* { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
        for (nonlocal_j = 0; nonlocal_j < N; ++nonlocal_j)
          ;
       }
 
-#pragma acc kernels loop \
+#pragma acc kernels loop /* { dg-line l_compute_loop[incr c_compute_loop] } */ \
   gang(static:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) \
   wait(nonlocal_arg, nonlocal_arg + 1, nonlocal_arg + 2) async
+    /* { dg-note {variable 'nonlocal_i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop } */
+    /* { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop } */
     for (nonlocal_i = 0; nonlocal_i < N; ++nonlocal_i)
       {
 #pragma acc cache (nonlocal_a[nonlocal_i:2])
        nonlocal_a[nonlocal_i] = 100;
-#pragma acc loop seq tile(*)
+#pragma acc loop seq tile(*) /* { dg-line l_loop[incr c_loop] } */
+       /* { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
        for (nonlocal_j = 0; nonlocal_j < N; ++nonlocal_j)
          ;
-#pragma acc loop auto independent tile(*)
+#pragma acc loop auto independent tile(*) /* { dg-line l_loop[incr c_loop] } */
+       /* { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
        for (nonlocal_j = 0; nonlocal_j < N; ++nonlocal_j)
          ;
       }
index 70c9ec8ebfae695c93bb9617bef60fef5882f3c9..407006948da38fb6914db473fd2c60c5f0cb4f8f 100644 (file)
@@ -1,5 +1,17 @@
 /* Exercise nested function decomposition, gcc/tree-nested.c.  */
 
+/* { dg-additional-options "-fopt-info-all-omp" } */
+
+/* { dg-additional-options "--param=openacc-privatization=noisy" } */
+
+/* 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 0] }
+   { dg-message dummy {} { target iN-VAl-Id } l_dummy } to avoid
+   "WARNING: dg-line var l_dummy defined, but not used".  */
+
 int
 main (void)
 {
@@ -9,7 +21,9 @@ main (void)
     int i;
 #pragma acc parallel
     {
-#pragma acc loop
+#pragma acc loop /* { dg-line l_loop[incr c_loop] } */
+      /* { dg-note {variable 'i' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
+      /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop$c_loop } */
       for (i = 0; i < m; i+= k)
        j = (m + i - j) * l;
     }
@@ -19,7 +33,11 @@ main (void)
     int x, y, z;
 #pragma acc parallel
     {
-#pragma acc loop collapse (3)
+#pragma acc loop collapse (3) /* { dg-line l_loop[incr c_loop] } */
+      /* { dg-note {variable 'z' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
+      /* { dg-note {variable 'y' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
+      /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
+      /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop$c_loop } */
       for (x = 0; x < k; x++)
        for (y = -5; y < l; y++)
          for (z = 0; z < m; z++)
@@ -31,7 +49,11 @@ main (void)
     int x, y, z;
 #pragma acc parallel reduction (+:j)
     {
-#pragma acc loop reduction (+:j) collapse (3)
+#pragma acc loop reduction (+:j) collapse (3) /* { dg-line l_loop[incr c_loop] } */
+      /* { dg-note {variable 'z' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
+      /* { dg-note {variable 'y' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
+      /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop } */
+      /* { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop$c_loop } */
       for (x = 0; x < k; x++)
        for (y = -5; y < l; y++)
          for (z = 0; z < m; z++)
index 005193f30a7c21458454c211561d7a88f7c75abf..50fd0c82e1451114f94ad69f12ac7b48a97b961e 100644 (file)
@@ -1,6 +1,20 @@
 ! Exercise nested function decomposition, gcc/tree-nested.c.
 ! See gcc/testsuite/gcc.dg/goacc/nested-function-1.c for the C version.
 
+! { dg-additional-options "-fopt-info-all-omp" }
+
+! { dg-additional-options "--param=openacc-privatization=noisy" }
+! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
+! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
+
+! 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_compute_loop 0 c_loop 0] }
+! { dg-message dummy {} { target iN-VAl-Id } l_dummy } to avoid
+! "WARNING: dg-line var l_dummy defined, but not used".
+
 program main
   integer, parameter :: N = 100
   integer :: nonlocal_arg
@@ -29,14 +43,20 @@ contains
 
     !$acc kernels loop &
     !$acc gang(num:local_arg) worker(local_arg) vector(local_arg) &
-    !$acc wait async(local_arg)
+    !$acc wait async(local_arg) ! { dg-line l_compute_loop[incr c_compute_loop] }
+    ! { dg-note {variable 'local_i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-note {variable 'local_i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop }
     do local_i = 1, N
        !$acc cache (local_a(local_i:local_i + 5))
        local_a(local_i) = 100
-       !$acc loop seq tile(*)
+       !$acc loop seq tile(*) ! { dg-line l_loop[incr c_loop] }
+       ! { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop }
        do local_j = 1, N
        enddo
-       !$acc loop auto independent tile(1)
+       !$acc loop auto independent tile(1) ! { dg-line l_loop[incr c_loop] }
+       ! { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop }
        do local_j = 1, N
        enddo
     enddo
@@ -44,14 +64,20 @@ contains
 
     !$acc kernels loop &
     !$acc gang(static:local_arg) worker(local_arg) vector(local_arg) &
-    !$acc wait(local_arg, local_arg + 1, local_arg + 2) async
+    !$acc wait(local_arg, local_arg + 1, local_arg + 2) async ! { dg-line l_compute_loop[incr c_compute_loop] }
+    ! { dg-note {variable 'local_i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-note {variable 'local_i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop }
     do local_i = 1, N
        !$acc cache (local_a(local_i:local_i + 4))
        local_a(local_i) = 100
-       !$acc loop seq tile(1)
+       !$acc loop seq tile(1) ! { dg-line l_loop[incr c_loop] }
+       ! { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop }
        do local_j = 1, N
        enddo
-       !$acc loop auto independent tile(*)
+       !$acc loop auto independent tile(*) ! { dg-line l_loop[incr c_loop] }
+       ! { dg-note {variable 'local_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop }
        do local_j = 1, N
        enddo
     enddo
@@ -68,14 +94,20 @@ contains
 
     !$acc kernels loop &
     !$acc gang(num:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) &
-    !$acc wait async(nonlocal_arg)
+    !$acc wait async(nonlocal_arg) ! { dg-line l_compute_loop[incr c_compute_loop] }
+    ! { dg-note {variable 'nonlocal_i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-note {variable 'nonlocal_i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop }
     do nonlocal_i = 1, N
        !$acc cache (nonlocal_a(nonlocal_i:nonlocal_i + 3))
        nonlocal_a(nonlocal_i) = 100
-       !$acc loop seq tile(2)
+       !$acc loop seq tile(2) ! { dg-line l_loop[incr c_loop] }
+       ! { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop }
        do nonlocal_j = 1, N
        enddo
-       !$acc loop auto independent tile(3)
+       !$acc loop auto independent tile(3) ! { dg-line l_loop[incr c_loop] }
+       ! { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop }
        do nonlocal_j = 1, N
        enddo
     enddo
@@ -83,14 +115,20 @@ contains
 
     !$acc kernels loop &
     !$acc gang(static:nonlocal_arg) worker(nonlocal_arg) vector(nonlocal_arg) &
-    !$acc wait(nonlocal_arg, nonlocal_arg + 1, nonlocal_arg + 2) async
+    !$acc wait(nonlocal_arg, nonlocal_arg + 1, nonlocal_arg + 2) async ! { dg-line l_compute_loop[incr c_compute_loop] }
+    ! { dg-note {variable 'nonlocal_i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-note {variable 'nonlocal_i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-note {variable 'parm\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_compute_loop$c_compute_loop }
+    ! { dg-optimized {assigned OpenACC seq loop parallelism} {} { target *-*-* } l_compute_loop$c_compute_loop }
     do nonlocal_i = 1, N
        !$acc cache (nonlocal_a(nonlocal_i:nonlocal_i + 2))
        nonlocal_a(nonlocal_i) = 100
-       !$acc loop seq tile(*)
+       !$acc loop seq tile(*) ! { dg-line l_loop[incr c_loop] }
+       ! { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop }
        do nonlocal_j = 1, N
        enddo
-       !$acc loop auto independent tile(*)
+       !$acc loop auto independent tile(*) ! { dg-line l_loop[incr c_loop] }
+       ! { dg-note {variable 'nonlocal_j' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop$c_loop }
        do nonlocal_j = 1, N
        enddo
     enddo
index 6a573218b7a4d6e3d2ef820bbaa3013fb0c02036..95d8752f8a03a9a6ee30d48ce970348999a58245 100644 (file)
@@ -1,6 +1,14 @@
 ! { dg-do run }
 ! { dg-options "-fno-inline" }
 
+! { dg-additional-options "-fopt-info-all-omp" }
+! { dg-additional-options "-foffload=-fopt-info-all-omp" }
+
+! { dg-additional-options "--param=openacc-privatization=noisy" }
+! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
+! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
+! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
+
   interface
     recursive function fact (x)
       !$acc routine
   integer, parameter :: n = 10
   integer :: a(n), i
   !$acc parallel
-  !$acc loop
+  !$acc loop ! { dg-line l_loop1 }
+  ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 }
+  !   { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 }
+  !   { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 }
+  ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 }
+  ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 }
   do i = 1, n
-     a(i) = fact (i)
+     a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
   end do
   !$acc end parallel
   do i = 1, n
@@ -27,6 +40,6 @@ recursive function fact (x) result (res)
   if (x < 1) then
      res = 1
   else
-     res = x * fact (x - 1)
+     res = x * fact (x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
   end if
 end function fact
index b697974790288f1dd6eb7eb2967521414d4a0292..9e8eb96dbf223d47934b8f3b643d487f343741af 100644 (file)
@@ -1,6 +1,14 @@
 ! { dg-do run }
 ! { dg-options "-fno-inline" }
 
+! { dg-additional-options "-fopt-info-all-omp" }
+! { dg-additional-options "-foffload=-fopt-info-all-omp" }
+
+! { dg-additional-options "--param=openacc-privatization=noisy" }
+! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
+! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
+! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
+
   module m1
     contains
     recursive function fact (x) result (res)
@@ -10,7 +18,7 @@
       if (x < 1) then
          res = 1
       else
-         res = x * fact (x - 1)
+         res = x * fact (x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
       end if
     end function fact
   end module m1
   integer, parameter :: n = 10
   integer :: a(n), i
   !$acc parallel
-  !$acc loop
+  !$acc loop ! { dg-line l_loop1 }
+  ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 }
+  !   { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 }
+  !   { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 }
+  ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 }
+  ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 }
   do i = 1, n
-     a(i) = fact (i)
+     a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
   end do
   !$acc end parallel
   do i = 1, n
index e7b9d8ab364f775cbb4e712e2a16338737e4491d..38218263851d091a1cb706acc199575c688dbb79 100644 (file)
@@ -1,14 +1,27 @@
 ! { dg-do run }
 ! { dg-options "-fno-inline" }
 
+! { dg-additional-options "-fopt-info-all-omp" }
+! { dg-additional-options "-foffload=-fopt-info-all-omp" }
+
+! { dg-additional-options "--param=openacc-privatization=noisy" }
+! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
+! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
+! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
+
   integer, parameter :: n = 10
   integer :: a(n), i
   integer, external :: fact
   !$acc routine (fact)
   !$acc parallel
-  !$acc loop
+  !$acc loop ! { dg-line l_loop1 }
+  ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 }
+  !   { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 }
+  !   { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 }
+  ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 }
+  ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 }
   do i = 1, n
-     a(i) = fact (i)
+     a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
   end do
   !$acc end parallel
   do i = 1, n
@@ -22,6 +35,6 @@ recursive function fact (x) result (res)
   if (x < 1) then
      res = 1
   else
-     res = x * fact (x - 1)
+     res = x * fact (x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
   end if
 end function fact
index b1a1338dd8c87c66c1c057d3d7d1f2f8041e4336..dbd2e4de743045182049838a45cbedcb3ba4c6a2 100644 (file)
@@ -1,6 +1,14 @@
 ! { dg-do run }
 ! { dg-options "-fno-inline" }
 
+! { dg-additional-options "-fopt-info-all-omp" }
+! { dg-additional-options "-foffload=-fopt-info-all-omp" }
+
+! { dg-additional-options "--param=openacc-privatization=noisy" }
+! { dg-additional-options "-foffload=--param=openacc-privatization=noisy" }
+! Prune a few: uninteresting, and potentially varying depending on GCC configuration (data types):
+! { dg-prune-output {note: variable 'D\.[0-9]+' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} }
+
 program main
   implicit none
   integer, parameter :: n = 10
@@ -8,9 +16,14 @@ program main
   integer, external :: fact
   !$acc routine (fact)
   !$acc parallel
-  !$acc loop
+  !$acc loop ! { dg-line l_loop1 }
+  ! { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} {} { target *-*-* } l_loop1 }
+  !   { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'vector'} {} { target *-*-* } l_loop1 }
+  !   { dg-note {variable 'i' adjusted for OpenACC privatization level: 'vector'} {} { target { ! openacc_host_selected } } l_loop1 }
+  ! { dg-note {variable 'i\.[0-9]+' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} {} { target *-*-* } l_loop1 }
+  ! { dg-optimized {assigned OpenACC gang vector loop parallelism} {} { target *-*-* } l_loop1 }
   do i = 1, n
-     a(i) = fact (i)
+     a(i) = fact (i) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
   end do
   !$acc end parallel
   do i = 1, n
@@ -26,6 +39,6 @@ recursive function fact (x) result (res)
   if (x < 1) then
      res = 1
   else
-     res = x * fact(x - 1)
+     res = x * fact(x - 1) ! { dg-optimized {assigned OpenACC seq loop parallelism} }
   end if
 end function fact