diff options
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/parse.c | 19 |
2 files changed, 23 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 73235c6..8cff148 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2016-06-01 Jakub Jelinek <jakub@redhat.com> + + * parse.c (case_decl): Move ST_OMP_* to ... + (case_omp_decl): ... here, new macro. + (verify_st_order): For case_omp_decl, complain about + p->state >= ORDER_EXEC, but don't change p->state otherwise. + 2016-05-26 Jakub Jelinek <jakub@redhat.com> * openmp.c (resolve_omp_clauses): Warn if chunk_size is known not to diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index dd7aa6a..1081b2e 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -1390,9 +1390,13 @@ next_statement (void) #define case_decl case ST_ATTR_DECL: case ST_COMMON: case ST_DATA_DECL: \ case ST_EQUIVALENCE: case ST_NAMELIST: case ST_STATEMENT_FUNCTION: \ - case ST_TYPE: case ST_INTERFACE: case ST_OMP_THREADPRIVATE: \ - case ST_PROCEDURE: case ST_OMP_DECLARE_SIMD: case ST_OMP_DECLARE_REDUCTION: \ - case ST_OMP_DECLARE_TARGET: case ST_OACC_ROUTINE: case ST_OACC_DECLARE + case ST_TYPE: case ST_INTERFACE: case ST_PROCEDURE: case ST_OACC_ROUTINE: \ + case ST_OACC_DECLARE + +/* OpenMP declaration statements. */ + +#define case_omp_decl case ST_OMP_THREADPRIVATE: case ST_OMP_DECLARE_SIMD: \ + case ST_OMP_DECLARE_TARGET: case ST_OMP_DECLARE_REDUCTION /* Block end statements. Errors associated with interchanging these are detected in gfc_match_end(). */ @@ -2488,6 +2492,14 @@ verify_st_order (st_state *p, gfc_statement st, bool silent) p->state = ORDER_SPEC; break; + case_omp_decl: + /* The OpenMP directives have to be somewhere in the specification + part, but there are no further requirements on their ordering. + Thus don't adjust p->state, just ignore them. */ + if (p->state >= ORDER_EXEC) + goto order; + break; + case_executable: case_exec_markers: if (p->state < ORDER_EXEC) @@ -3563,6 +3575,7 @@ loop: case ST_STRUCTURE_DECL: case ST_DERIVED_DECL: case_decl: + case_omp_decl: declSt: if (!verify_st_order (&ss, st, false)) { |