]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Add '-Wopenacc-parallelism'
authorThomas Schwinge <thomas@codesourcery.com>
Fri, 23 Apr 2021 10:23:51 +0000 (12:23 +0200)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Mon, 10 May 2021 17:12:14 +0000 (10:12 -0700)
... to diagnose potentially suboptimal choices regarding OpenACC parallelism.

Not enabled by default: too noisy ("*potentially* suboptimal choices"); see
XFAILed 'dg-bogus'es.

gcc/c-family/
* c.opt (Wopenacc-parallelism): New.
gcc/fortran/
* lang.opt (Wopenacc-parallelism): New.
gcc/
* omp-offload.c (oacc_validate_dims): Implement
'-Wopenacc-parallelism'.
* doc/invoke.texi (-Wopenacc-parallelism): Document.
gcc/testsuite/
* c-c++-common/goacc/diag-parallelism-1.c: New.
* c-c++-common/goacc/acc-icf.c: Specify '-Wopenacc-parallelism',
and match diagnostics, as appropriate.
* c-c++-common/goacc/classify-kernels-unparallelized.c: Likewise.
* c-c++-common/goacc/classify-kernels.c: Likewise.
* c-c++-common/goacc/classify-parallel.c: Likewise.
* c-c++-common/goacc/classify-routine.c: Likewise.
* c-c++-common/goacc/classify-serial.c: Likewise.
* c-c++-common/goacc/kernels-decompose-1.c: Likewise.
* c-c++-common/goacc/kernels-decompose-2.c: Likewise.
* c-c++-common/goacc/parallel-dims-1.c: Likewise.
* c-c++-common/goacc/parallel-reduction.c: Likewise.
* c-c++-common/goacc/pr70688.c: Likewise.
* c-c++-common/goacc/routine-1.c: Likewise.
* c-c++-common/goacc/routine-level-of-parallelism-2.c: Likewise.
* c-c++-common/goacc/uninit-dim-clause.c: Likewise.
* gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise.
* gfortran.dg/goacc/classify-kernels.f95: Likewise.
* gfortran.dg/goacc/classify-parallel.f95: Likewise.
* gfortran.dg/goacc/classify-routine.f95: Likewise.
* gfortran.dg/goacc/classify-serial.f95: Likewise.
* gfortran.dg/goacc/kernels-decompose-1.f95: Likewise.
* gfortran.dg/goacc/kernels-decompose-2.f95: Likewise.
* gfortran.dg/goacc/parallel-tree.f95: Likewise.
* gfortran.dg/goacc/routine-4.f90: Likewise.
* gfortran.dg/goacc/routine-level-of-parallelism-1.f90: Likewise.
* gfortran.dg/goacc/routine-module-mod-1.f90: Likewise.
* gfortran.dg/goacc/routine-multiple-directives-1.f90: Likewise.
* gfortran.dg/goacc/uninit-dim-clause.f95: Likewise.
libgomp/
* testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: Specify
'-Wopenacc-parallelism', and match diagnostics, as appropriate.
* testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/mode-transitions.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/pr85381-3.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/private-variables.c:
Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/reduction-7.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c: Likewise.
* testsuite/libgomp.oacc-c-c++-common/static-variable-1.c:
Likewise.
* testsuite/libgomp.oacc-fortran/optional-private.f90: Likewise.
* testsuite/libgomp.oacc-fortran/par-reduction-2-1.f: Likewise.
* testsuite/libgomp.oacc-fortran/par-reduction-2-2.f: Likewise.
* testsuite/libgomp.oacc-fortran/parallel-dims.f90: Likewise.
* testsuite/libgomp.oacc-fortran/parallel-reduction.f90: Likewise.
* testsuite/libgomp.oacc-fortran/pr84028.f90: Likewise.
* testsuite/libgomp.oacc-fortran/private-variables.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-1.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
* testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
* testsuite/libgomp.oacc-fortran/routine-7.f90: Likewise.

Co-Authored-By: Nathan Sidwell <nathan@codesourcery.com>
Co-Authored-By: Tom de Vries <vries@codesourcery.com>
Co-Authored-By: Julian Brown <julian@codesourcery.com>
Co-Authored-By: Kwok Cheung Yeung <kcy@codesourcery.com>
(cherry picked from commit 22cff118f7526bec195ed6e41452980820fdf3a8)

66 files changed:
gcc/ChangeLog.omp
gcc/c-family/ChangeLog.omp
gcc/c-family/c.opt
gcc/doc/invoke.texi
gcc/fortran/ChangeLog.omp
gcc/fortran/lang.opt
gcc/omp-offload.c
gcc/testsuite/ChangeLog.omp
gcc/testsuite/c-c++-common/goacc/acc-icf.c
gcc/testsuite/c-c++-common/goacc/classify-kernels-unparallelized.c
gcc/testsuite/c-c++-common/goacc/classify-kernels.c
gcc/testsuite/c-c++-common/goacc/classify-parallel.c
gcc/testsuite/c-c++-common/goacc/classify-routine.c
gcc/testsuite/c-c++-common/goacc/classify-serial.c
gcc/testsuite/c-c++-common/goacc/diag-parallelism-1.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/goacc/kernels-decompose-1.c
gcc/testsuite/c-c++-common/goacc/kernels-decompose-2.c
gcc/testsuite/c-c++-common/goacc/parallel-dims-1.c
gcc/testsuite/c-c++-common/goacc/parallel-reduction.c
gcc/testsuite/c-c++-common/goacc/pr70688.c
gcc/testsuite/c-c++-common/goacc/routine-1.c
gcc/testsuite/c-c++-common/goacc/routine-level-of-parallelism-2.c
gcc/testsuite/c-c++-common/goacc/uninit-dim-clause.c
gcc/testsuite/gfortran.dg/goacc/classify-kernels-unparallelized.f95
gcc/testsuite/gfortran.dg/goacc/classify-kernels.f95
gcc/testsuite/gfortran.dg/goacc/classify-parallel.f95
gcc/testsuite/gfortran.dg/goacc/classify-routine.f95
gcc/testsuite/gfortran.dg/goacc/classify-serial.f95
gcc/testsuite/gfortran.dg/goacc/kernels-decompose-1.f95
gcc/testsuite/gfortran.dg/goacc/kernels-decompose-2.f95
gcc/testsuite/gfortran.dg/goacc/parallel-tree.f95
gcc/testsuite/gfortran.dg/goacc/routine-4.f90
gcc/testsuite/gfortran.dg/goacc/routine-level-of-parallelism-1.f90
gcc/testsuite/gfortran.dg/goacc/routine-module-mod-1.f90
gcc/testsuite/gfortran.dg/goacc/routine-multiple-directives-1.f90
gcc/testsuite/gfortran.dg/goacc/uninit-dim-clause.f95
libgomp/ChangeLog.omp
libgomp/testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c
libgomp/testsuite/libgomp.oacc-c-c++-common/loop-w-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/mode-transitions.c
libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c
libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-dims.c
libgomp/testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c
libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-3.c
libgomp/testsuite/libgomp.oacc-c-c++-common/private-variables.c
libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-5.c
libgomp/testsuite/libgomp.oacc-c-c++-common/reduction-7.c
libgomp/testsuite/libgomp.oacc-c-c++-common/routine-g-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/routine-w-1.c
libgomp/testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c
libgomp/testsuite/libgomp.oacc-c-c++-common/static-variable-1.c
libgomp/testsuite/libgomp.oacc-fortran/optional-private.f90
libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-1.f
libgomp/testsuite/libgomp.oacc-fortran/par-reduction-2-2.f
libgomp/testsuite/libgomp.oacc-fortran/parallel-dims.f90
libgomp/testsuite/libgomp.oacc-fortran/parallel-reduction.f90
libgomp/testsuite/libgomp.oacc-fortran/pr84028.f90
libgomp/testsuite/libgomp.oacc-fortran/private-variables.f90
libgomp/testsuite/libgomp.oacc-fortran/reduction-1.f90
libgomp/testsuite/libgomp.oacc-fortran/reduction-5.f90
libgomp/testsuite/libgomp.oacc-fortran/reduction-6.f90
libgomp/testsuite/libgomp.oacc-fortran/routine-7.f90

index 14c6f4b84034c75c88f1aaaecdfbdf70aaa85b4d..dc5a0321e8562977a22cb600fddb7e283ad88ac4 100644 (file)
@@ -1,3 +1,12 @@
+2021-04-30  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       Backport from mainline
+       2021-04-23  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * omp-offload.c (oacc_validate_dims): Implement
+       '-Wopenacc-parallelism'.
+       * doc/invoke.texi (-Wopenacc-parallelism): Document.
+
 2021-04-07  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        * omp-low.c (is_oacc_parallel_or_serial): Handle
index 34570313969a7f208d348af28778bf37f3a88348..b5be331200cdb9bc6c43245bc2d4001208b3e164 100644 (file)
@@ -1,3 +1,10 @@
+2021-04-30  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       Backport from mainline
+       2021-04-23  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * c.opt (Wopenacc-parallelism): New.
+
 2020-08-30  Sandra Loosemore  <sandra@codesourcery.com>
 
        * c-omp.c (end_test_ok_for_annotation_r): New.
index c595da46a9272a9490e500bce3ee1421d963934c..517762ca0da224a43e8726c604b2d4cc8eeafc3f 100644 (file)
@@ -1041,6 +1041,10 @@ Wopenacc-kernels-annotate-loops
 C ObjC C++ ObjC++ Warning Var(warn_openacc_kernels_annotate_loops) Init(0)
 Warn about loops in OpenACC kernels regions that cannot be parallelized.
 
+Wopenacc-parallelism
+C C++ Var(warn_openacc_parallelism) Warning
+Warn about potentially suboptimal choices related to OpenACC parallelism.
+
 Wopenmp-simd
 C C++ Var(warn_openmp_simd) Warning LangEnabledBy(C C++,Wall)
 Warn if a simd directive is overridden by the vectorizer cost model.
index e89e6bc8abd109e772d26ce9456e8ec8577731a8..014283778266a1639ebd4ff320364bf164677837 100644 (file)
@@ -365,7 +365,9 @@ Objective-C and Objective-C++ Dialects}.
 -Wno-multichar  -Wmultistatement-macros  -Wnonnull  -Wnonnull-compare @gol
 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
 -Wnull-dereference  -Wno-odr @gol
--Wopenacc-kernels-annotate-loops  -Wopenmp-simd @gol
+-Wopenacc-kernels-annotate-loops
+-Wopenacc-parallelism  @gol
+-Wopenmp-simd @gol
 -Wno-overflow  -Woverlength-strings  -Wno-override-init-side-effects @gol
 -Wpacked  -Wno-packed-bitfield-compat  -Wpacked-not-aligned  -Wpadded @gol
 -Wparentheses  -Wno-pedantic-ms-format @gol
@@ -8762,6 +8764,12 @@ Warn about @code{for} (C/C++) or @code{DO} (Fortran) loops in OpenACC
 kernels regions that cannot be automatically annotated for
 parallelization with @option{-fopenacc-kernels-annotate-loops}.
 
+@item -Wopenacc-parallelism
+@opindex Wopenacc-parallelism
+@opindex Wno-openacc-parallelism
+@cindex OpenACC accelerator programming
+Warn about potentially suboptimal choices related to OpenACC parallelism.
+
 @item -Wopenmp-simd
 @opindex Wopenmp-simd
 @opindex Wno-openmp-simd
index be9045cd6f34720302c3aa3136f7022c6f3cc3a4..165fe3bdbfb18731c822427f5aab294b686144d9 100644 (file)
@@ -1,3 +1,10 @@
+2021-04-30  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       Backport from mainline
+       2021-04-23  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * lang.opt (Wopenacc-parallelism): New.
+
 2021-04-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        Backport from mainline
index e47eb9c61545ad48db6a0292ef918fe1c3e57419..dba333448c112593be78beb9ea1a96f54d94f994 100644 (file)
@@ -289,6 +289,10 @@ Wopenacc-kernels-annotate-loops
 Fortran
 ; Documented in C
 
+Wopenacc-parallelism
+Fortran
+; Documented in C
+
 Wopenmp-simd
 Fortran
 ; Documented in C
index 821b60a392380c183669f9fa3a97603424a5ce93..7ffe3cd7f8f6906fc6a4f9f83190e299f381cc7b 100644 (file)
@@ -1050,6 +1050,7 @@ oacc_validate_dims (tree fn, tree attrs, int *dims, int level, unsigned used)
   check = false;
 #endif
   if (check
+      && warn_openacc_parallelism
       && !lookup_attribute ("oacc kernels", DECL_ATTRIBUTES (fn)))
     {
       static char const *const axes[] =
@@ -1061,13 +1062,13 @@ oacc_validate_dims (tree fn, tree attrs, int *dims, int level, unsigned used)
        else if ((used & GOMP_DIM_MASK (ix)) && dims[ix] == 1)
          /* There is partitioned execution, but the user requested a
             dimension size of 1.  They're probably confused.  */
-         warning_at (DECL_SOURCE_LOCATION (fn), 0,
+         warning_at (DECL_SOURCE_LOCATION (fn), OPT_Wopenacc_parallelism,
                      "region contains %s partitioned code but"
                      " is not %s partitioned", axes[ix], axes[ix]);
        else if (!(used & GOMP_DIM_MASK (ix)) && dims[ix] != 1)
          /* The dimension is explicitly partitioned to non-unity, but
             no use is made within the region.  */
-         warning_at (DECL_SOURCE_LOCATION (fn), 0,
+         warning_at (DECL_SOURCE_LOCATION (fn), OPT_Wopenacc_parallelism,
                      "region is %s partitioned but"
                      " does not contain %s partitioned code",
                      axes[ix], axes[ix]);
index e6d06f5ff5a08ea319a3e056fb2cdb9048ae6801..11cf751c5817e202019b5bea98a168aa0e321daa 100644 (file)
@@ -1,3 +1,38 @@
+2021-04-30  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       Backport from mainline
+       2021-04-23  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * c-c++-common/goacc/diag-parallelism-1.c: New.
+       * c-c++-common/goacc/acc-icf.c: Specify '-Wopenacc-parallelism',
+       and match diagnostics, as appropriate.
+       * c-c++-common/goacc/classify-kernels-unparallelized.c: Likewise.
+       * c-c++-common/goacc/classify-kernels.c: Likewise.
+       * c-c++-common/goacc/classify-parallel.c: Likewise.
+       * c-c++-common/goacc/classify-routine.c: Likewise.
+       * c-c++-common/goacc/classify-serial.c: Likewise.
+       * c-c++-common/goacc/kernels-decompose-1.c: Likewise.
+       * c-c++-common/goacc/kernels-decompose-2.c: Likewise.
+       * c-c++-common/goacc/parallel-dims-1.c: Likewise.
+       * c-c++-common/goacc/parallel-reduction.c: Likewise.
+       * c-c++-common/goacc/pr70688.c: Likewise.
+       * c-c++-common/goacc/routine-1.c: Likewise.
+       * c-c++-common/goacc/routine-level-of-parallelism-2.c: Likewise.
+       * c-c++-common/goacc/uninit-dim-clause.c: Likewise.
+       * gfortran.dg/goacc/classify-kernels-unparallelized.f95: Likewise.
+       * gfortran.dg/goacc/classify-kernels.f95: Likewise.
+       * gfortran.dg/goacc/classify-parallel.f95: Likewise.
+       * gfortran.dg/goacc/classify-routine.f95: Likewise.
+       * gfortran.dg/goacc/classify-serial.f95: Likewise.
+       * gfortran.dg/goacc/kernels-decompose-1.f95: Likewise.
+       * gfortran.dg/goacc/kernels-decompose-2.f95: Likewise.
+       * gfortran.dg/goacc/parallel-tree.f95: Likewise.
+       * gfortran.dg/goacc/routine-4.f90: Likewise.
+       * gfortran.dg/goacc/routine-level-of-parallelism-1.f90: Likewise.
+       * gfortran.dg/goacc/routine-module-mod-1.f90: Likewise.
+       * gfortran.dg/goacc/routine-multiple-directives-1.f90: Likewise.
+       * gfortran.dg/goacc/uninit-dim-clause.f95: Likewise.
+
 2021-04-29  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        * c-c++-common/goacc/classify-serial.c: Surpress warnings.  Dump
index 8601ace5db1400384c1c3851657bd89334942901..bc2e0fd19b9220b9ac2069396fb7a3f5b08be178 100644 (file)
@@ -2,7 +2,12 @@
 
 /* { dg-additional-options "-fopenacc -O2 -fdump-ipa-icf" }  */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #pragma acc routine gang
+/* { 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 *-*-* } } */
 {
@@ -16,6 +21,8 @@ routine1 (int n) /* { dg-bogus "region is worker partitioned but does not contai
 }
 
 #pragma acc routine gang
+/* { 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 *-*-* } } */
 {
index b438efd45728a1ad89d607fa8b197326b80a3108..d8706b9a0a0a7ae9c2a496cb9cc4364934edcb6e 100644 (file)
@@ -8,6 +8,9 @@
    { dg-additional-options "-fdump-tree-parloops1-all" }
    { dg-additional-options "-fdump-tree-oaccloops" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #define N 1024
 
 extern unsigned int *__restrict a;
index 368e6e26566777f0e4ecc39388b8d29e66f3cee9..e3dc5c01a29b948a9b854eaf50dacdbdb6f78b32 100644 (file)
@@ -8,6 +8,9 @@
    { dg-additional-options "-fdump-tree-parloops1-all" }
    { dg-additional-options "-fdump-tree-oaccloops" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #define N 1024
 
 extern unsigned int *__restrict a;
index 5a034ba35ad695406d1984a44a3e99556c5fa778..6225a4381dd4a8d9a27754fdcd12dbedb34082d1 100644 (file)
@@ -6,6 +6,9 @@
    { dg-additional-options "-fdump-tree-ompexp" }
    { dg-additional-options "-fdump-tree-oaccloops" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #define N 1024
 
 extern unsigned int *__restrict a;
index af0069a6f78a34be7f894ae19664366596fd6e07..3454771ed92b4e6be4e65bd2affa4e06612c5c62 100644 (file)
@@ -6,6 +6,9 @@
    { dg-additional-options "-fdump-tree-ompexp" }
    { dg-additional-options "-fdump-tree-oaccloops" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #define N 1024
 
 extern unsigned int *__restrict a;
index 63dd41511c447542bfba58c5d39684857e64b5c7..0c21919758bb1fb9a170bb2b430c005449a35634 100644 (file)
@@ -6,6 +6,9 @@
    { dg-additional-options "-fdump-tree-ompexp" }
    { dg-additional-options "-fdump-tree-oaccloops" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #define N 1024
 
 extern unsigned int *__restrict a;
@@ -15,6 +18,11 @@ 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 }
+     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++)
     c[i] = a[i] + b[i];
 }
diff --git a/gcc/testsuite/c-c++-common/goacc/diag-parallelism-1.c b/gcc/testsuite/c-c++-common/goacc/diag-parallelism-1.c
new file mode 100644 (file)
index 0000000..6ee7bd0
--- /dev/null
@@ -0,0 +1,124 @@
+/* Diagnostics about potentially suboptimal choices related to OpenACC
+   parallelism.
+
+   { dg-additional-options "-Wopenacc-parallelism" }
+*/
+
+
+//TODO 'kernels'
+
+//TODO 'serial'
+
+//TODO 'routine'
+
+//TODO Fortran
+
+
+static void f1 ()
+{
+  int ary[10];
+
+
+#pragma acc parallel num_gangs (1)
+  /* { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop gang
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel num_workers (1)
+  /* { dg-warning "region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop worker
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel vector_length (1)
+  /* { dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop vector
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+}
+
+
+static void f2 ()
+{
+  int ary[10];
+
+
+#pragma acc parallel num_gangs (8)
+  /* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop worker
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel num_gangs (8)
+  /* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop vector
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel num_gangs (8)
+  /* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop worker vector
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel num_workers (8)
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop gang
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel num_workers (8)
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop vector
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel num_workers (8)
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop gang vector
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel vector_length (8)
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop gang
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel vector_length (8)
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop worker
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+
+#pragma acc parallel vector_length (8)
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
+  {
+    #pragma acc loop gang worker
+    for (int i = 0; i < 10; i++)
+      ary[i] = i;
+  }
+}
index 87219c88fac7da5f0d0cd059e0270054ca768131..f549cbadfa7e3faee1adf3006e4df312df2db9c3 100644 (file)
@@ -5,6 +5,9 @@
 /* { dg-additional-options "--param=openacc-kernels=decompose" }
    { dg-additional-options "-fdump-tree-omp_oacc_kernels_decompose" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 /* See also '../../gfortran.dg/goacc/kernels-decompose-1.f95'.  */
 
 /* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
index 0681b4323a53567eb5b810f3a315c1b4123ab02b..f5f6a7e3e8b78f74c93d1e1617922a8c0fcfd4a7 100644 (file)
@@ -5,6 +5,9 @@
 /* { dg-additional-options "--param=openacc-kernels=decompose" }
 /* { dg-additional-options "-O2" } for 'parloops'.  */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 /* See also '../../gfortran.dg/goacc/kernels-decompose-2.f95'.  */
 
 /* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
@@ -116,7 +119,8 @@ main ()
        b[j] = f_w (c[j]);
   }
 
-#pragma acc kernels /* { dg-warning "region contains gang partitioned code but is not gang partitioned" } */
+#pragma acc kernels
+  /* { dg-bogus "warning: region contains gang partitioned code but is not gang partitioned" "TODO 'kernels'" { xfail *-*-* } .-1 } */
   {
     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"?
index 6cdbebe01283c09753281f5a7e7359609639bff5..6b1e7b22451016032f61dd10143f0c33b090ae8d 100644 (file)
@@ -1,13 +1,19 @@
 /* Valid use of OpenACC parallelism dimensions clauses: num_gangs, num_workers,
    vector_length.  */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 void f(int i)
 {
 #pragma acc kernels \
   num_gangs(i) num_workers(i) vector_length(i)
   ;
 
-#pragma acc parallel /* { dg-bogus "region is (gang|worker|vector) partitioned" "" { xfail *-*-* } } */ \
-  num_gangs(i) num_workers(i) vector_length(i)
+#pragma acc parallel num_gangs(i) num_workers(i) vector_length(i)
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO runtime" { xfail *-*-* } .-1 }
+     { dg-bogus "warning: region is worker partitioned but does not contain worker partitioned code" "TODO runtime" { xfail *-*-* } .-2 }
+     { dg-bogus "warning: region is vector partitioned but does not contain vector partitioned code" "TODO runtime" { xfail *-*-* } .-3 }
+     TODO 'region is [...] partitioned' isn't correct for 'i == 1'.  */
   ;
 }
index 9a142c4e02d05fa23bc29673d72ca53416bb7b35..c5c0edc98ee69b26f2006c31f0307ce217f4e219 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 int
 main ()
 {
@@ -6,7 +9,8 @@ main ()
 
 #pragma acc data copy (dummy)
   {
-#pragma acc parallel num_gangs (10) copy (sum) reduction (+:sum) /* { dg-warning "gang partitioned" } */
+#pragma acc parallel num_gangs (10) copy (sum) reduction (+:sum)
+    /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } */
     {
       int v = 5;
       sum += 10 + v;
index 3f5584a503e0f3c068dabf2e45f09a6746bbcb1d..e96a8530772f2d5983e538c22a3007d423344e07 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 const int n = 100;
 
 int
@@ -21,7 +24,8 @@ parallel_reduction ()
 
 #pragma acc data copy (dummy)
   {
-#pragma acc parallel num_gangs (10) copy (sum) reduction (+:sum) /* { dg-warning "region is gang partitioned" } */
+#pragma acc parallel num_gangs (10) copy (sum) reduction (+:sum)
+    /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } */
     {
       int v = 5;
       sum += 10 + v;
@@ -36,11 +40,13 @@ main ()
 {
   int i, s = 0;
 
-#pragma acc parallel num_gangs (10) copy (s) reduction (+:s) /* { dg-warning "region is gang partitioned" } */
+#pragma acc parallel num_gangs (10) copy (s) reduction (+:s)
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } */
   for (i = 0; i < n; i++)
     s += i+1;
 
-#pragma acc parallel num_gangs (10) reduction (+:s) copy (s) /* { dg-warning "region is gang partitioned" } */
+#pragma acc parallel num_gangs (10) reduction (+:s) copy (s)
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } */
   for (i = 0; i < n; i++)
     s += i+1;
 
index e32398d3649f71a162aaa198e3002fcbd3f72c6f..a11e602db363cfffc7da8f645498e4c920a7d6d3 100644 (file)
@@ -1,17 +1,24 @@
-/* Test valid use of clauses with routine.  */
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
 
 #pragma acc routine gang
-void gang (void) /* { dg-warning "partitioned" 3 } */
+/* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .+3 }
+   { 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 *-*-* } .+1 } */
+void gang (void)
 {
 }
 
 #pragma acc routine worker
-void worker (void) /* { dg-warning "partitioned" 2 } */
+/* { 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 *-*-* } .+1 } */
+void worker (void)
 {
 }
 
 #pragma acc routine vector
-void vector (void) /* { dg-warning "partitioned" 1 } */
+/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .+1 } */
+void vector (void)
 {
 }
 
index d40cdadb3d8d49c2e49455ce43596be493c853c4..0e0e4a728f05d7835c537046d9426b41d842cd37 100644 (file)
@@ -2,8 +2,14 @@
    with the OpenACC 'routine' directive.  The Fortran counterpart is
    '../../gfortran.dg/goacc/routine-level-of-parallelism-1.f90'.  */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #pragma acc routine gang
-void g_1 (void) /* { dg-warning "region is gang partitioned but does not contain gang partitioned code" } */
+/* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .+3 }
+   { 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 *-*-* } .+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 } */
index 45df2d61efb23894ce6e4d33393d36381e4c939d..9ff305f9acc714240a98a07602304aea427b5fa7 100644 (file)
@@ -1,20 +1,23 @@
 /* { dg-additional-options "-Wuninitialized" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 void acc_parallel()
 {
   int i, j, k;
 
-  #pragma acc parallel loop gang num_gangs(i) /* { dg-warning "is used uninitialized" } */
-  for (i = 0; i < 1; i++)
-    ;
+  #pragma acc parallel num_gangs(i) /* { dg-warning "is used uninitialized" } */
+  /* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-1 } */
+  ;
 
-  #pragma acc parallel loop worker num_workers(j) /* { dg-warning "is used uninitialized" } */
-  for (j = 0; j < 1; j++)
-    ;
+  #pragma acc parallel num_workers(j) /* { dg-warning "is used uninitialized" } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  ;
 
-  #pragma acc parallel loop vector vector_length(k) /* { dg-warning "is used uninitialized" } */
-  for (k = 0; k < 1; k++)
-    ;
+  #pragma acc parallel vector_length(k) /* { dg-warning "is used uninitialized" } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
+  ;
 }
 
 void acc_kernels()
index d6126f2b7f1f11cd028208ecaad4136341501ad3..7abf12f3d58d3790f00bf38ee1806f3ef463f4f6 100644 (file)
@@ -8,6 +8,9 @@
 ! { dg-additional-options "-fdump-tree-parloops1-all" }
 ! { dg-additional-options "-fdump-tree-oaccloops" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program main
   implicit none
   integer, parameter :: n = 1024
index 39516f84cd6b02f8fd6558c94b1394beef75a4cf..fb19a98d8a595ffd979adf467b0a23e6ad9c97a7 100644 (file)
@@ -8,6 +8,9 @@
 ! { dg-additional-options "-fdump-tree-parloops1-all" }
 ! { dg-additional-options "-fdump-tree-oaccloops" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program main
   implicit none
   integer, parameter :: n = 1024
index 20bbdb0fbd39c92d0971143802875a647dd6cac9..ce4c08ff219dd047949ed65684492de48280f130 100644 (file)
@@ -6,6 +6,9 @@
 ! { dg-additional-options "-fdump-tree-ompexp" }
 ! { dg-additional-options "-fdump-tree-oaccloops" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program main
   implicit none
   integer, parameter :: n = 1024
index ed24cee10d8718512bf790f146cb7abe4b31409f..02c929d31a001cf64b3351b3fd4072035f68c3ba 100644 (file)
@@ -6,6 +6,9 @@
 ! { dg-additional-options "-fdump-tree-ompexp" }
 ! { dg-additional-options "-fdump-tree-oaccloops" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 subroutine ROUTINE
   !$acc routine worker
   integer, parameter :: n = 1024
index 16d415406f3082a9b6ec261748397db762374be4..1e949fa47f3f41a52a902c3b2954f46f010a99c8 100644 (file)
@@ -6,6 +6,9 @@
 ! { dg-additional-options "-fdump-tree-ompexp" }
 ! { dg-additional-options "-fdump-tree-oaccloops" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program main
   implicit none
   integer, parameter :: n = 1024
@@ -15,6 +18,9 @@ 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 "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 }
   do i = 0, n - 1
      c(i) = a(i) + b(i)
   end do
index e2523504ef536c6741d5476c3d9ca3bc7501fa45..ddaf7f8e43d47461958ca759c2e6bdcad0c7a081 100644 (file)
@@ -5,6 +5,9 @@
 ! { dg-additional-options "--param=openacc-kernels=decompose" }
 ! { dg-additional-options "-fdump-tree-omp_oacc_kernels_decompose" }
 
+! { 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'
index 20310b61e093a1dd84075180a02043ec7c9b3bea..7c3e4a70e71917318fba96665fa7cd0d27b392d7 100644 (file)
@@ -5,6 +5,9 @@
 ! { dg-additional-options "--param=openacc-kernels=decompose" }
 ! { dg-additional-options "-O2" } for 'parloops'.
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 ! See also '../../c-c++-common/goacc/kernels-decompose-2.c'.
 
 ! It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
@@ -117,7 +120,8 @@ program main
   end if
   !$acc end kernels
 
-  !$acc kernels  ! { dg-warning "region contains gang partitioned code but is not gang partitioned" }
+  !$acc kernels
+  ! { dg-bogus "warning: region contains gang partitioned code but is not gang partitioned" "TODO 'kernels'" { xfail *-*-* } .-1 }
   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 }
index 83aaf699cdbbafeaa74827999675bfcfbb909b5b..c51cb2a0504899426694e1458f330b57ac60daad 100644 (file)
@@ -2,6 +2,9 @@
 
 ! test for tree-dump-original and spaces-commas
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program test
   implicit none
   integer :: q, i, j, k, m, n, o, p, r, s, t, u, v, w
index 3fb60e71ae0fa9fd93f554ca937fba35b6b63134..1ae76ce21eb367421fc74677d07d244428e243c0 100644 (file)
@@ -1,5 +1,8 @@
 ! Test invalid calls to routines.
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 module param
   integer, parameter :: N = 32
 end module param
index 9986c0c8d50517ebe65d489a715b575ed148fed5..99929f136f698f4277712f4815218374fe712517 100644 (file)
@@ -2,10 +2,14 @@
 ! with the OpenACC routine directive.  The C/C++ counterpart is
 ! '../../c-c++-common/goacc/routine-level-of-parallelism-2.c'.
 
-subroutine g_1 ! { dg-warning "region is gang partitioned but does not contain gang partitioned code" }
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
+subroutine g_1
   !$acc routine gang
-! { dg-bogus "region is worker partitioned but does not contain worker partitioned code" "worker partitioned" { xfail *-*-* } .-2 }
-! { dg-bogus "region is vector partitioned but does not contain vector partitioned code" "worker partitioned" { xfail *-*-* } .-3 }
+  ! { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-2 }
+  ! { 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 *-*-* } .-4 }
 end subroutine g_1
 
 subroutine s_1_2a
index 2ea4094927de4717da83bb96c1a08434911ca54f..b7770752605e7b53f803be2ce1922d70ea0157ac 100644 (file)
@@ -2,6 +2,9 @@
 
 ! { dg-additional-options "-fopt-info-optimized-omp" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 module routine_module_mod_1
 contains
   subroutine s_1
@@ -53,6 +56,7 @@ contains
   subroutine g_1 ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" }
     implicit none
     !$acc routine gang
+    ! { dg-bogus "warning: region is worker partitioned but does not contain worker partitioned code" "TODO default 'gang' 'vector'" { xfail *-*-* } .-3 }
 
     integer :: i
 
index e39f6b58b25b83cd26827ee9f7102c02ed556451..622a9d9ccce8a8ec601c3f5774733d4d0a3825ed 100644 (file)
@@ -1,5 +1,8 @@
 ! Check for valid cases of multiple OpenACC 'routine' directives.
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
       SUBROUTINE s_1
 !$ACC ROUTINE(s_1)
 !$ACC ROUTINE(s_1) SEQ
 !$ACC ROUTINE(s_2)
       END SUBROUTINE s_2
 
-      SUBROUTINE v_1 ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" }
+      SUBROUTINE v_1
 !$ACC ROUTINE VECTOR
 !$ACC ROUTINE VECTOR
 !$ACC ROUTINE(v_1) VECTOR
 !$ACC ROUTINE VECTOR
+! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-5 }
       END SUBROUTINE v_1
 
-      SUBROUTINE v_2 ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" }
+      SUBROUTINE v_2
 !$ACC ROUTINE(v_2) VECTOR
 !$ACC ROUTINE VECTOR
 !$ACC ROUTINE(v_2) VECTOR
+! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-4 }
       END SUBROUTINE v_2
 
       SUBROUTINE sub_1
index 15466cf8a518e19d6539d3402a1e71b706105cf6..59e923f90fbf61bfe17c182684bf0dedb77f760d 100644 (file)
@@ -1,23 +1,23 @@
 ! { dg-additional-options "-Wuninitialized" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 subroutine acc_parallel
   implicit none
   integer :: i, j, k
 
-  !$acc parallel loop gang num_gangs(i) ! { dg-warning "is used uninitialized" }
-  do i = 0, 1
-  end do
-  !$acc end parallel loop
+  !$acc parallel num_gangs(i) ! { dg-warning "is used uninitialized" }
+  ! { dg-warning "region is gang partitioned but does not contain gang partitioned code" "" { target *-*-* } .-1 }
+  !$acc end parallel
 
-  !$acc parallel loop worker num_workers(j) ! { dg-warning "is used uninitialized" }
-  do j = 0, 1
-  end do
-  !$acc end parallel loop
+  !$acc parallel num_workers(j) ! { dg-warning "is used uninitialized" }
+  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
+  !$acc end parallel
 
-  !$acc parallel loop vector vector_length(k) ! { dg-warning "is used uninitialized" }
-  do k = 0, 1
-  end do
-  !$acc end parallel loop
+  !$acc parallel vector_length(k) ! { dg-warning "is used uninitialized" }
+  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 }
+  !$acc end parallel
 end subroutine acc_parallel
 
 subroutine acc_kernels
index f74d92a67411da2d8adc875b9f64ef44ade3c2f7..08a8ed0637aef611b157c5c564b4fa4676ccfcb9 100644 (file)
@@ -1,3 +1,43 @@
+2021-04-30  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       Backport from mainline
+       2021-04-23  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * testsuite/libgomp.oacc-c-c++-common/firstprivate-1.c: Specify
+       '-Wopenacc-parallelism', and match diagnostics, as appropriate.
+       * testsuite/libgomp.oacc-c-c++-common/loop-auto-1.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/loop-red-w-1.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/loop-red-w-2.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/loop-w-1.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/mode-transitions.c:
+       Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/par-reduction-1.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/par-reduction-2.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/parallel-dims.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/parallel-reduction.c:
+       Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/pr85381-3.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/private-variables.c:
+       Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/reduction-5.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/reduction-7.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/routine-g-1.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/routine-w-1.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/routine-wv-2.c: Likewise.
+       * testsuite/libgomp.oacc-c-c++-common/static-variable-1.c:
+       Likewise.
+       * testsuite/libgomp.oacc-fortran/optional-private.f90: Likewise.
+       * testsuite/libgomp.oacc-fortran/par-reduction-2-1.f: Likewise.
+       * testsuite/libgomp.oacc-fortran/par-reduction-2-2.f: Likewise.
+       * testsuite/libgomp.oacc-fortran/parallel-dims.f90: Likewise.
+       * testsuite/libgomp.oacc-fortran/parallel-reduction.f90: Likewise.
+       * testsuite/libgomp.oacc-fortran/pr84028.f90: Likewise.
+       * testsuite/libgomp.oacc-fortran/private-variables.f90: Likewise.
+       * testsuite/libgomp.oacc-fortran/reduction-1.f90: Likewise.
+       * testsuite/libgomp.oacc-fortran/reduction-5.f90: Likewise.
+       * testsuite/libgomp.oacc-fortran/reduction-6.f90: Likewise.
+       * testsuite/libgomp.oacc-fortran/routine-7.f90: Likewise.
+
 2021-04-30  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        Backport from mainline
index 14bc3af4a97d86d7ba99ada3c55095451e1f092e..0990e3db22404d3891b247cbcd27e4bee312cd36 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include  <openacc.h>
 
 
@@ -117,8 +120,8 @@ void t4 ()
     arr[i] = 3;
 
 #pragma acc parallel firstprivate(x) copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 119 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 119 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
 #pragma acc loop gang
     for (i = 0; i < 32; i++)
index 426c44c0a1fb7d2976178cd7e4b1450cd3e78443..418275592972aa8cce8040e13ad6ba8b853ac88f 100644 (file)
@@ -3,6 +3,9 @@
 
 /* { dg-additional-options "-fopenacc-dim=32" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <stdio.h>
 #include <openacc.h>
 #include <gomp-constants.h>
@@ -150,7 +153,8 @@ int gang_1 (int *ary, int size)
 {
   clear (ary, size);
   
-#pragma acc parallel num_gangs (32) num_workers (32) vector_length(32) copy(ary[0:size]) firstprivate (size)/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } } */
+#pragma acc parallel num_gangs (32) num_workers (32) vector_length(32) copy(ary[0:size]) firstprivate (size)
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   {
 #pragma acc loop auto independent
     for (int jx = 0; jx <  size  / 64; jx++)
index 7344fa8bf0011948b1c8379017bdbf8427b5fef1..2f749e04ae0cf223d29a0fbfbeb986025fa8d948 100644 (file)
@@ -1,4 +1,6 @@
-/* { dg-additional-options "-w" } */
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <stdio.h>
 #include <openacc.h>
 #include <gomp-constants.h>
@@ -13,6 +15,7 @@ int main ()
 
 #pragma acc parallel num_workers(32) vector_length(32) copy(ondev) \
            copyout(workersize)
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
 #pragma acc loop worker reduction(+:t)
     for (unsigned ix = 0; ix < N; ix++)
index d99877ab8a9dca92cd931dac1b1997e181e7927c..9727e22d3c2b4691dab33fdd270f60e962541941 100644 (file)
@@ -1,4 +1,6 @@
-/* { dg-additional-options "-w" } */
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <stdio.h>
 #include <openacc.h>
 #include <gomp-constants.h>
@@ -13,6 +15,7 @@ int main ()
 
 #pragma acc parallel num_workers(32) vector_length(32) copy(q) copy(ondev) \
            copyout(workersize)
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     int t = q;
     
index 8731c805b7984189c1a6d68303e9189bf5f8f8c1..d639e14a67ccf01c15584d7aafa8877e299b97e5 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <stdio.h>
 #include <openacc.h>
 #include <gomp-constants.h>
@@ -16,7 +19,7 @@ int main ()
   
 #pragma acc parallel num_workers(32) vector_length(32) copy(ary) copy(ondev) \
            copyout(workersize)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 17 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } .-2 } */
   {
 #pragma acc loop worker
     for (unsigned ix = 0; ix < N; ix++)
index f62daf031a05ac77e6672d39e5fe8e7e62aaaa82..6c989abedf5cc4f783da051741496f3fc1f32578 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 /* Miscellaneous test cases for gang/worker/vector mode transitions.  */
 
 #include <assert.h>
@@ -287,7 +290,7 @@ void t7()
   int n = 0;
   #pragma acc parallel copy(n) \
                       num_gangs(1) num_workers(1) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 288 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     n++;
   }
@@ -311,7 +314,7 @@ void t8()
 
       #pragma acc parallel copy(arr) \
                           num_gangs(gangs) num_workers(1) vector_length(32)
-      /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 312 } */
+      /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
       {
        int j;
        #pragma acc loop gang
@@ -341,7 +344,7 @@ void t9()
 
       #pragma acc parallel copy(arr) \
                           num_gangs(gangs) num_workers(1) vector_length(32)
-      /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 342 } */
+      /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
       {
        int j;
        #pragma acc loop gang
@@ -374,7 +377,7 @@ void t10()
 
       #pragma acc parallel copy(arr) \
                           num_gangs(gangs) num_workers(1) vector_length(32)
-      /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 375 } */
+      /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
       {
        int j;
        #pragma acc loop gang
@@ -408,7 +411,7 @@ void t11()
 
   #pragma acc parallel copy(arr) \
                       num_gangs(1024) num_workers(1) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 409 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     int j;
 
@@ -447,7 +450,7 @@ void t12()
 
   #pragma acc parallel copyout(fizz, buzz, fizzbuzz) \
                       num_gangs(NUM_GANGS) num_workers(1) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 448 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     int j;
     
@@ -494,7 +497,7 @@ void t13()
 
   #pragma acc parallel copy(arr) \
                       num_gangs(8) num_workers(8) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 495 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     int j;
     #pragma acc loop gang
@@ -620,7 +623,7 @@ void t16()
 
   #pragma acc parallel copy(n, arr) \
                       num_gangs(8) num_workers(16) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 621 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     int j;
     #pragma acc loop gang
@@ -673,7 +676,7 @@ void t17()
 
        #pragma acc parallel copyin(arr_a) copyout(arr_b) \
                             num_gangs(num_gangs) num_workers(num_workers) vector_length(32)
-       /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 674 } */
+       /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
        {
          int j;
          #pragma acc loop gang
@@ -891,8 +894,8 @@ void t21()
 
   #pragma acc parallel copy(arr) \
                       num_gangs(8) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 892 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 892 } */
+  /* { 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 } */
   {
     int j;
     #pragma acc loop gang
@@ -916,8 +919,8 @@ void t22()
 
   #pragma acc parallel copy(arr) \
                       num_gangs(8) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 917 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 917 } */
+  /* { 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 } */
   {
     int j;
     #pragma acc loop gang
@@ -944,8 +947,8 @@ void t23()
 
   #pragma acc parallel copy(arr) \
                       num_gangs(8) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 945 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 945 } */
+  /* { 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 } */
   {
     int j;
     #pragma acc loop gang
@@ -972,8 +975,8 @@ void t24()
 
   #pragma acc parallel copy(arr) \
                       num_gangs(8) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 973 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 973 } */
+  /* { 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 } */
   {
     int j;
     #pragma acc loop gang
@@ -1005,7 +1008,7 @@ void t25()
 
   #pragma acc parallel copy(arr) \
                       num_gangs(8) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 1006 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-2 } */
   {
     int j;
     #pragma acc loop gang
@@ -1038,7 +1041,7 @@ void t26()
 
   #pragma acc parallel copy(arr) \
                       num_gangs(8) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 1039 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-2 } */
   {
     int j;
     #pragma acc loop gang
@@ -1089,8 +1092,8 @@ void t27()
 
   #pragma acc parallel copy(n, arr) copyout(ondev) \
          num_gangs(ACTUAL_GANGS) num_workers(8) vector_length(32)
-  /* { dg-warning "region is gang partitioned but does not contain gang partitioned code" "gang" { target *-*-* } 1090 } */
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 1090 } */
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'atomic'" { xfail *-*-* } .-2 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-3 } */
   {
     int j;
 
index 0c1ecc68e9df98728d4e2fed04f81e2f5a2a5b00..8157cff109a724651d24a82b978c50b8d30f727a 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <assert.h>
 
 /* Test of reduction on parallel directive.  */
@@ -16,6 +19,9 @@ main (int argc, char *argv[])
 #endif
   #pragma acc parallel num_gangs(GANGS) num_workers(32) vector_length(32) \
     reduction(+:res1) copy(res2, res1)
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail { ! openacc_host_selected } } .-2 } */
+  /* { 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 *-*-* } .-4 } */
   {
     res1 += 5;
 
@@ -37,6 +43,9 @@ main (int argc, char *argv[])
 #endif
   #pragma acc parallel num_gangs(GANGS) num_workers(32) vector_length(32) \
     reduction(*:res1) copy(res1, res2)
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail { ! openacc_host_selected } } .-2 } */
+  /* { 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 *-*-* } .-4 } */
   {
     res1 *= 5;
 
index e3ed281610d49c07d70a4f1a717f691222b5d54a..8b7900e66ffa43e0421919a60ae1f8701f55c7fc 100644 (file)
@@ -1,6 +1,9 @@
 /* Test of reduction on parallel directive (with async).  */
 /* See also Fortran variants in "../libgomp.oacc-fortran/par-reduction-2*".  */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <assert.h>
 #include <openacc.h>
 
@@ -16,6 +19,9 @@ main (int argc, char *argv[])
 #endif
   #pragma acc parallel num_gangs(GANGS) num_workers(32) vector_length(32) \
     reduction(+:res1) copy(res1, res2) async(1)
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail { ! openacc_host_selected } } .-2 } */
+  /* { 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 *-*-* } .-4 } */
   {
     res1 += 5;
 
@@ -39,6 +45,9 @@ main (int argc, char *argv[])
 #endif
   #pragma acc parallel num_gangs(GANGS) num_workers(32) vector_length(32) \
     reduction(*:res1) copy(res1, res2) async(1)
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail { ! openacc_host_selected } } .-2 } */
+  /* { 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 *-*-* } .-4 } */
   {
     res1 *= 5;
 
index 511bedb9f81adfb0e038d4b78d35b492cf0d7b33..99d4333cdc80530652c8c29bc07b6fca855fecae 100644 (file)
@@ -1,6 +1,9 @@
 /* OpenACC parallelism dimensions clauses: num_gangs, num_workers,
    vector_length.  */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 /* See also '../libgomp.oacc-fortran/parallel-dims.f90'.  */
 
 #include <limits.h>
@@ -105,6 +108,7 @@ int main ()
     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 } */
     {
       /* We're actually executing with num_gangs (1).  */
       gangs_actual = 1;
@@ -134,6 +138,7 @@ int main ()
     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++ } } */
+    /* { dg-warning "region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } .-2 } */
     {
       /* We're actually executing with num_workers (1).  */
       workers_actual = 1;
@@ -164,6 +169,7 @@ int main ()
 #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 } */ \
   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 } */
     {
       /* We're actually executing with vector_length (1), just the GCC nvptx
         back end enforces vector_length (32).  */
@@ -209,6 +215,7 @@ 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))
        {
@@ -615,10 +622,9 @@ int main ()
     gangs_max = workers_max = vectors_max = INT_MIN;
 #pragma acc serial copy (vectors_actual) \
   copy (gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max)
-  /* { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_selected } 616 } */
-  /* { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } 616 } */
-  /* { dg-warning "region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } 616 } */
-  /* { dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target *-*-* } 616 } */
+    /* { 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 } */
     {
       if (acc_on_device (acc_device_nvidia))
        {
index 80745816fff995e67484bad57f5dd4a80e3596d4..b15ee8b22ff3fb62328e20d1ce187af638ad5f4f 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run } */
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
 
 #include <stdlib.h>
 #include <openacc.h>
@@ -15,6 +16,7 @@ main ()
 #pragma acc data copy (dummy)
   {
 #pragma acc parallel num_gangs (N) reduction (+:s1) copy(s1)
+    /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } */
     {
       s1++;
     }
@@ -35,6 +37,7 @@ main ()
   s2 = 0;
 
 #pragma acc parallel num_gangs (10) reduction (+:s1, s2) copy(s1, s2)
+  /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 } */
   {
     s1++;
     s2 += N;
index 53fb049f99210c7aa67877cffe347dd4d79064c0..10a4116676b45b568c3e6f48c130ce3b10892d8d 100644 (file)
@@ -2,10 +2,14 @@
    { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
 /* { dg-additional-options "-foffload=-fdump-rtl-mach -w" } */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 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)
 {
@@ -13,6 +17,8 @@ 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)
 {
index f0c3447dfef1e5b5144d8930e67ddb7206b55daa..3cc6f150f63464be7bd406017294fc8241e91257 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <assert.h>
 #include <openacc.h>
 
@@ -22,8 +25,8 @@ void local_g_1()
     arr[i] = 3;
 
   #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 24 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 24 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     int x;
 
@@ -297,8 +300,8 @@ void loop_g_1()
     arr[i] = i;
 
   #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 299 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 299 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     #pragma acc loop gang private(x)
     for (i = 0; i < 32; i++)
@@ -324,7 +327,7 @@ void loop_g_2()
     arr[i] = i;
 
   #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 326 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   {
     #pragma acc loop gang private(x)
     for (i = 0; i < 32; i++)
@@ -353,7 +356,7 @@ void loop_g_3()
     arr[i] = i;
 
   #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 355 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
   {
     #pragma acc loop gang private(x)
     for (i = 0; i < 32; i++)
@@ -382,7 +385,7 @@ void loop_g_4()
     arr[i] = i;
 
   #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 384 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   {
     #pragma acc loop gang private(x)
     for (i = 0; i < 32; i++)
@@ -415,7 +418,7 @@ void loop_g_5()
     arr[i] = i;
 
   #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 417 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   {
     #pragma acc loop gang private(x)
     for (i = 0; i < 32; i++)
@@ -446,7 +449,7 @@ void loop_g_6()
     arr[i] = i;
 
   #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 448 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   {
     #pragma acc loop gang private(pt)
     for (i = 0; i < 32; i++)
@@ -568,7 +571,7 @@ void loop_w_1()
     arr[i] = i;
 
   #pragma acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 570 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   {
     int j;
 
@@ -885,8 +888,8 @@ void parallel_g_1()
     arr[i] = 3;
 
   #pragma acc parallel private(x) copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 887 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 887 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     #pragma acc loop gang(static:1)
     for (i = 0; i < 32; i++)
@@ -916,7 +919,7 @@ void parallel_g_2()
     arr[i] = i;
 
   #pragma acc parallel private(x) copy(arr) num_gangs(32) num_workers(2) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 918 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   {
     #pragma acc loop gang
     for (i = 0; i < 32; i++)
index 1cec9f152c4fa50ddca0c95a91eb6adba5547d1b..bae1dee6ad2f815e2fb5eb180c44847858391ccd 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-do run } */
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
 
 /* Multiple reductions.  */
 
@@ -45,6 +46,7 @@ main (void)
   /* Nvptx targets require a vector_length or 32 in to allow spinlocks with
      gangs.  */
   check_reduction (num_workers (nw) vector_length (vl), worker);
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   check_reduction (vector_length (vl), vector);
   check_reduction (num_gangs (ng) num_workers (nw) vector_length (vl), gang
                   worker vector);
index 68ae919ea6f7f0a6298f950805f088db2386ed13..c2fb922a7f142dc31b881db27ba447ab3ced62cc 100644 (file)
@@ -1,5 +1,8 @@
 /* Tests of reduction on loop directive.  */
 
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <assert.h>
 
 
@@ -14,8 +17,8 @@ void g_np_1()
     arr[i] = i;
 
   #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 16 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 16 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     #pragma acc loop gang reduction(+:res)
     for (i = 0; i < 1024; i++)
@@ -30,8 +33,8 @@ void g_np_1()
   res = hres = 1;
 
   #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 32 } */
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 32 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     #pragma acc loop gang reduction(*:res)
     for (i = 0; i < 12; i++)
@@ -56,7 +59,7 @@ void gv_np_1()
     arr[i] = i;
 
   #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 58 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
   {
     #pragma acc loop gang vector reduction(+:res)
     for (i = 0; i < 1024; i++)
@@ -81,7 +84,7 @@ void gw_np_1()
     arr[i] = i;
 
   #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 83 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
   {
     #pragma acc loop gang worker reduction(+:res)
     for (i = 0; i < 1024; i++)
@@ -245,7 +248,7 @@ void v_p_1()
 
   #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \
                       private(res) copyout(out)
-  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 246 } */
+  /* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-2 } */
   {
     #pragma acc loop gang
     for (j = 0; j < 32; j++)
@@ -322,7 +325,7 @@ void w_p_1()
 
   #pragma acc parallel num_gangs(32) num_workers(32) vector_length(32) \
                       private(res) copyout(out)
-  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 323 } */
+  /* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
   {
     #pragma acc loop gang
     for (j = 0; j < 32; j++)
index 8c3b938506f2c3fb29d042e4d80b87d9df8ab33f..1536ce0ecb226f1df2911328acbd2ab01ca63791 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <stdio.h>
 #include <openacc.h>
 #include <gomp-constants.h>
@@ -6,8 +9,8 @@
 
 #pragma acc routine gang
 void __attribute__ ((noinline)) gang (int ary[N])
-/* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 8 } */
-/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 8 } */
+/* { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 } */
+/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 } */
 {
 #pragma acc loop gang
     for (unsigned ix = 0; ix < N; ix++)
index bf9228105c5fdee519fc976ed5c10f10756ffc4a..b9137d819352a25442ba9f7497ed17b114859006 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <stdio.h>
 #include <openacc.h>
 #include <gomp-constants.h>
@@ -6,7 +9,7 @@
 
 #pragma acc routine worker
 void __attribute__ ((noinline)) worker (int ary[N])
-/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 8 } */
+/* { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 } */
 {
 #pragma acc loop worker
   for (unsigned ix = 0; ix < N; ix++)
index de167c55c76287c621be67e2357c080882dbd44d..74b64df2d6c8d7b651fe6bd586aa67bf5b620707 100644 (file)
@@ -1,3 +1,6 @@
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 #include <stdio.h>
 #include <openacc.h>
 #include <gomp-constants.h>
@@ -45,6 +48,7 @@ int DoWorkVec (int nw)
 
   /* { dg-warning "region contains vector partitioned code but is not vector partitioned" "vector" { target openacc_radeon_accel_selected } 47 } */
 #pragma acc parallel num_workers(nw) vector_length (NUM_VECTORS) copy (ary)
+  /* { dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target openacc_radeon_accel_selected } .-1 } */
   {
     WorkVec ((int *)ary, WIDTH, HEIGHT, nw, NUM_VECTORS);
   }
index ccc0336bae305391619c809f58c9a7da4224ff12..0c071c3734667d293353f13f8dab96fb0e34298a 100644 (file)
@@ -9,7 +9,9 @@
    variables" (only visible to members of the GitHub OpenACC organization).
 */
 
-/* { dg-additional-options "-w" } */
+/* { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+   aspects of that functionality.  */
+
 
 #undef NDEBUG
 #include <assert.h>
@@ -64,6 +66,9 @@ static void t0_c(void)
 static const int t0_r_var_init = 61;
 
 #pragma acc routine gang
+/* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'atomic'" { xfail *-*-* } .+4 } */
+/* { 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 } */
 __attribute__((noinline))
 static int t0_r_r(void)
 {
@@ -124,6 +129,7 @@ static void t1_c(void)
     {
       int result = 0;
       int num_gangs_actual = -1;
+      /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'atomic'" { xfail *-*-* } .+1 } */
 #pragma acc parallel \
   num_gangs(num_gangs_request) \
   reduction(max:num_gangs_actual) \
@@ -154,6 +160,9 @@ static void t1_c(void)
 static const int t1_r2_var_init = 166;
 
 #pragma acc routine gang
+/* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'atomic'" { xfail *-*-* } .+4 } */
+/* { 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 } */
 __attribute__((noinline))
 static int t1_r2_r(void)
 {
@@ -246,6 +255,9 @@ static void t1_r2(void)
 static const int t2_var_init_2 = -55;
 
 #pragma acc routine gang
+/* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'atomic'" { xfail *-*-* } .+4 } */
+/* { 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 } */
 __attribute__((noinline))
 static int t2_r(void)
 {
@@ -287,6 +299,7 @@ static void t2(void)
           itself, meaning that all 'i = 0' execution has finished (on the
           device) before 'i = 1' is started (on the device), etc.  */
 
+       /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'atomic'" { xfail *-*-* } .+1 } */
 #pragma acc parallel \
   present(results_1) \
   num_gangs(num_gangs_request_1) \
@@ -309,6 +322,7 @@ static void t2(void)
          results_2[i][__builtin_goacc_parlevel_id(GOMP_DIM_GANG)] += t2_r();
        }
 
+       /* { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'atomic'" { xfail *-*-* } .+1 } */
 #pragma acc parallel \
   present(results_3) \
   num_gangs(num_gangs_request_3) \
index 6bc91b7a0bbaaf0978db9106a6fc80c939bb40c5..4d36d869b0c4fe3e0c58c8d817c5b7c91a1761c4 100644 (file)
@@ -4,6 +4,9 @@
 
 ! { dg-do run }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program main
   implicit none
 
@@ -30,8 +33,8 @@ contains
     end do
 
     !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-    ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 32 }
-    ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 32 }
+    ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
+    ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 }
     !$acc loop gang private(x)
     do i = 1, 32
        x = i * 2;
@@ -57,7 +60,7 @@ contains
     end do
 
     !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-    ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 59 }
+    ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
     !$acc loop gang private(pt)
     do i = 0, 31
        pt%x = i
index ff31116d9800bf7cb536016bf798f3f576adf9d6..408404cb7e66390027bfd78ad3babeb9d40cac31 100644 (file)
@@ -4,6 +4,9 @@
 
 !     { dg-do run }
 
+!     { dg-additional-options "-Wopenacc-parallelism" } for
+!     testing/documenting aspects of that functionality.
+
       PROGRAM MAIN
       IMPLICIT NONE
       INCLUDE "openacc_lib.h"
       RES2 = 0
 
 !$ACC PARALLEL NUM_GANGS(256) NUM_WORKERS(32) VECTOR_LENGTH(32)
-!$ACC& REDUCTION(+:RES1) COPY(RES1, RES2) ASYNC(1) ! { dg-warning "region is (gang|worker|vector) partitioned" }
+!$ACC& REDUCTION(+:RES1) COPY(RES1, RES2) ASYNC(1)
+!     { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-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 }
       res1 = res1 + 5
 
 !$ACC ATOMIC
       RES2 = 1
 
 !$ACC PARALLEL NUM_GANGS(8) NUM_WORKERS(32) VECTOR_LENGTH(32)
-!$ACC& REDUCTION(*:RES1) COPY(RES1, RES2) ASYNC(1) ! { dg-warning "region is (gang|worker|vector) partitioned" }
+!$ACC& REDUCTION(*:RES1) COPY(RES1, RES2) ASYNC(1)
+!     { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-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 }
       res1 = res1 * 5
 
 !$ACC ATOMIC
index 47c5ff3474d8f8300667e8e8f2b84083e2164d05..91ad99b256f9a3cfb02001c4cb968a1da897b983 100644 (file)
@@ -4,6 +4,9 @@
 
 !     { dg-do run }
 
+!     { dg-additional-options "-Wopenacc-parallelism" } for
+!     testing/documenting aspects of that functionality.
+
       PROGRAM MAIN
       USE OPENACC
       IMPLICIT NONE
       RES2 = 0
 
 !$ACC PARALLEL NUM_GANGS(256) NUM_WORKERS(32) VECTOR_LENGTH(32)
-!$ACC& REDUCTION(+:RES1) COPY(RES1, RES2) ASYNC(1) ! { dg-warning "region is (gang|worker|vector) partitioned" }
+!$ACC& REDUCTION(+:RES1) COPY(RES1, RES2) ASYNC(1)
+!     { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-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 }
       res1 = res1 + 5
 
 !$ACC ATOMIC
       RES2 = 1
 
 !$ACC PARALLEL NUM_GANGS(8) NUM_WORKERS(32) VECTOR_LENGTH(32)
-!$ACC& REDUCTION(*:RES1) COPY(RES1, RES2) ASYNC(1) ! { dg-warning "region is (gang|worker|vector) partitioned" }
+!$ACC& REDUCTION(*:RES1) COPY(RES1, RES2) ASYNC(1)
+!     { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction', 'atomic'" { xfail *-*-* } .-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 }
       res1 = res1 * 5
 
 !$ACC ATOMIC
index 0a7463a95acbc2d5a46fe5337177083b5ab85c1d..fae99b338a5e0b38b2d1030080263d86c480717c 100644 (file)
@@ -5,6 +5,9 @@
 ! { dg-do run }
 ! { dg-prune-output "command-line option '-fintrinsic-modules-path=.*' is valid for Fortran but not for C" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 ! See also '../libgomp.oacc-c-c++-common/parallel-dims.c'.
 
 module acc_routines
@@ -83,11 +86,10 @@ program main
   workers_max = -huge(gangs_max) - 1 ! INT_MIN
   vectors_max = -huge(gangs_max) - 1 ! INT_MIN
   !$acc serial copy (vectors_actual) &
-  !$acc   copy (gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max)
-  ! { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_selected } 86 }
-  ! { dg-warning "region contains gang partitioned code but is not gang partitioned" "" { target *-*-* } 86 }
-  ! { dg-warning "region contains worker partitioned code but is not worker partitioned" "" { target *-*-* } 86 }
-  ! { dg-warning "region contains vector partitioned code but is not vector partitioned" "" { target *-*-* } 86 }
+  !$acc   copy (gangs_min, gangs_max, workers_min, workers_max, vectors_min, vectors_max) ! { dg-warning "using vector_length \\(32\\), ignoring 1" "" { target openacc_nvidia_accel_selected } }
+  ! { 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" "TODO 'serial'" { xfail *-*-* } .-2 }
+  ! { dg-bogus "warning: region contains vector partitioned code but is not vector partitioned" "TODO 'serial'" { xfail *-*-* } .-3 }
   if (acc_on_device (acc_device_nvidia)) then
      ! The GCC nvptx back end enforces vector_length (32).
      ! It's unclear if that's actually permissible here;
index b926f4fe898524e027c3edf2acb38794befca158..edf748efbb454b0005633cfbbcb3583b47416f56 100644 (file)
@@ -1,5 +1,8 @@
 ! { dg-do run }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program reduction
   implicit none
   integer, parameter :: n = 10
@@ -10,6 +13,7 @@ program reduction
   s2 = 0
 
   !$acc parallel reduction(+:s1,s2) num_gangs (n) copy(s1)
+  ! { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 }
   s1 = s1 + 1
   s2 = s2 + 1
   !$acc end parallel
@@ -40,6 +44,7 @@ subroutine redsub(s1, s2, n)
   integer :: s1, s2, n
 
   !$acc parallel reduction(+:s1,s2) num_gangs (10)  copy(s1)
+  ! { dg-bogus "warning: region is gang partitioned but does not contain gang partitioned code" "TODO 'reduction'" { xfail *-*-* } .-1 }
   s1 = s1 + 1
   s2 = s2 + 1
   !$acc end parallel
index 8cb76a93d7f0ae457472f65918fb6386840d2097..e60322143ca9e765a785bfa9543cae9de6c09a59 100644 (file)
@@ -1,11 +1,15 @@
 ! { dg-do run }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program foo
   integer :: a(3,3,3), ll, lll
 
   a = 1
 
-  !$acc parallel num_gangs(1) num_workers(2) ! { dg-warning "region is worker partitioned" }
+  !$acc parallel num_gangs(1) num_workers(2)
+  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
 
   if (any(a(1:3,1:3,1:3).ne.1)) STOP 1
 
index fbff5ccd46ea6e18e4971c2752422ecb25cf3049..81043a22fd8de66e9e7e8b5403181cf452971536 100644 (file)
@@ -2,6 +2,9 @@
 
 ! { dg-do run }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 
 ! Test of gang-private variables declared on loop directive.
 
@@ -13,8 +16,8 @@ subroutine t1()
   end do
 
   !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 15 }
-  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 15 }
+  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
+  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 }
   !$acc loop gang private(x)
   do i = 1, 32
      x = i * 2;
@@ -39,7 +42,7 @@ subroutine t2()
   end do
 
   !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 41 }
+  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 }
   !$acc loop gang private(x)
   do i = 0, 31
      x = i * 2;
@@ -68,7 +71,7 @@ subroutine t3()
   end do
 
   !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 70 }
+  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
   !$acc loop gang private(x)
   do i = 0, 31
      x = i * 2;
@@ -102,7 +105,7 @@ subroutine t4()
   end do
 
   !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 104 }
+  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
   !$acc loop gang private(pt)
   do i = 0, 31
      pt%x = i
@@ -213,7 +216,7 @@ subroutine t7()
   end do
 
   !$acc parallel copy(arr) num_gangs(32) num_workers(8) vector_length(32)
-  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 215 }
+  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 }
   !$acc loop gang private(x)
   do i = 0, 31
      !$acc loop worker private(x)
@@ -513,8 +516,8 @@ subroutine t14()
   end do
 
   !$acc parallel private(x) copy(arr) num_gangs(n) num_workers(8) vector_length(32)
-  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "worker" { target *-*-* } 515 }
-  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "vector" { target *-*-* } 515 }
+  ! { dg-warning "region is worker partitioned but does not contain worker partitioned code" "" { target *-*-* } .-1 }
+  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-2 }
     !$acc loop gang(static:1)
     do i = 1, n
       x = i * 2;
index 40c1a86ab92362cbe46b796efb40b24ce1e631ea..95c3ed7ee9c0a121fb8b6ce9f01e018f2f0ed98f 100644 (file)
@@ -1,5 +1,8 @@
 ! { dg-do run }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 ! Integer reductions
 
 program reduction_1
@@ -279,6 +282,7 @@ program reduction_1
   !$acc end parallel
 
   !$acc parallel vector_length(vl) copy(rv)
+  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 }
   !$acc loop reduction(ior:rv) gang
   do i = 1, n
      rv = ior (rv, array(i))
index a529e22d9a27c9e1db9682c0de424411612b2b0f..5d1c1d99fce1c04a6cc1bcebd7f352e8921cb875 100644 (file)
@@ -1,5 +1,8 @@
 ! { dg-do run }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 ! subroutine reduction
 
 program reduction
@@ -45,6 +48,7 @@ subroutine redsub_worker(sum, n, c)
   sum = 0
 
   !$acc parallel copyin (n, c) num_workers(4) vector_length (32) copy(sum)
+  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 }
   !$acc loop reduction(+:sum) worker
   do i = 1, n
      sum = sum + c
index 249ed2edcbcf6a842c6a9309f964f8e14ca27b7a..6908d16418ca5e45a65e4af051286d39b080233f 100644 (file)
@@ -1,6 +1,9 @@
 ! { dg-do run }
 ! { dg-additional-options "-cpp" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+
 program reduction
   implicit none
 
@@ -28,6 +31,7 @@ program reduction
   !$acc end parallel
 
   !$acc parallel num_workers (4) vector_length (32)
+  ! { dg-warning "region is vector partitioned but does not contain vector partitioned code" "" { target *-*-* } .-1 }
   !$acc loop reduction(+:ws1, ws2) worker
   do i = 1, n
      ws1 = ws1 + 1
index 005d90b74fd9892004e07dafec0522b544ed3dd9..43622e3965a728b1281447ff280f31b1874ee578 100644 (file)
@@ -1,6 +1,10 @@
 ! { dg-do run }
 ! { dg-additional-options "-cpp" }
 
+! { dg-additional-options "-Wopenacc-parallelism" } for testing/documenting
+! aspects of that functionality.
+!TODO { dg-additional-options "-fno-inline" } for stable results regarding OpenACC 'routine'.
+
 #define M 8
 #define N 32
 
@@ -96,6 +100,8 @@ end subroutine worker
 
 subroutine gang (a)
   !$acc routine gang
+  ! { 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 }
   integer, intent (inout) :: a(N)
   integer :: i