aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2019-02-28 21:31:23 +0100
committerThomas Schwinge <tschwinge@gcc.gnu.org>2019-02-28 21:31:23 +0100
commite5fd6684b9577e822997ceedabfeaa7d61722fe2 (patch)
treea9ce3a476a0cc9f399634c7fe84677a40a285410 /gcc/fortran/openmp.c
parent6f87db2d7823ff70eca4fa76950aafe8a98d7356 (diff)
downloadgcc-e5fd6684b9577e822997ceedabfeaa7d61722fe2.zip
gcc-e5fd6684b9577e822997ceedabfeaa7d61722fe2.tar.gz
gcc-e5fd6684b9577e822997ceedabfeaa7d61722fe2.tar.bz2
[PR72741] For all Fortran OpenACC 'routine' directive variants check for multiple clauses specifying the level of parallelism
gcc/fortran/ PR fortran/72741 * gfortran.h (enum oacc_routine_lop): Add OACC_ROUTINE_LOP_ERROR. * openmp.c (gfc_oacc_routine_lop, gfc_match_oacc_routine): Use it. * trans-decl.c (add_attributes_to_decl): Likewise. gcc/testsuite/ PR fortran/72741 * gfortran.dg/goacc/routine-multiple-lop-clauses-1.f90: New file. Co-Authored-By: Cesar Philippidis <cesar@codesourcery.com> From-SVN: r269286
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 6999ac3..50b91f2 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -2265,7 +2265,7 @@ gfc_oacc_routine_lop (gfc_omp_clauses *clauses)
}
if (n_lop_clauses > 1)
- gfc_error ("Multiple loop axes specified for routine");
+ ret = OACC_ROUTINE_LOP_ERROR;
}
return ret;
@@ -2280,6 +2280,7 @@ gfc_match_oacc_routine (void)
gfc_symbol *sym = NULL;
gfc_omp_clauses *c = NULL;
gfc_oacc_routine_name *n = NULL;
+ oacc_routine_lop lop = OACC_ROUTINE_LOP_NONE;
old_loc = gfc_current_locus;
@@ -2352,6 +2353,13 @@ gfc_match_oacc_routine (void)
!= MATCH_YES))
return MATCH_ERROR;
+ lop = gfc_oacc_routine_lop (c);
+ if (lop == OACC_ROUTINE_LOP_ERROR)
+ {
+ gfc_error ("Multiple loop axes specified for routine at %C");
+ goto cleanup;
+ }
+
if (isym != NULL)
{
/* Diagnose any OpenACC 'routine' directive that doesn't match the
@@ -2381,8 +2389,7 @@ gfc_match_oacc_routine (void)
gfc_current_ns->proc_name->name,
&old_loc))
goto cleanup;
- gfc_current_ns->proc_name->attr.oacc_routine_lop
- = gfc_oacc_routine_lop (c);
+ gfc_current_ns->proc_name->attr.oacc_routine_lop = lop;
}
else
/* Something has gone wrong, possibly a syntax error. */