diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-06-01 14:21:38 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-06-01 14:21:38 +0200 |
commit | 3e32893c0bba66df33a1143afcb45e345172360a (patch) | |
tree | 3dfc018192a37399a5ca433cddee738e5cd60c81 /gcc/fortran/parse.c | |
parent | 8c38360082278de6400ac277e15f75edecc8eb39 (diff) | |
download | gcc-3e32893c0bba66df33a1143afcb45e345172360a.zip gcc-3e32893c0bba66df33a1143afcb45e345172360a.tar.gz gcc-3e32893c0bba66df33a1143afcb45e345172360a.tar.bz2 |
parse.c (case_decl): Move ST_OMP_* to ...
* 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.
* gfortran.dg/gomp/order-1.f90: New test.
* gfortran.dg/gomp/order-2.f90: New test.
From-SVN: r236987
Diffstat (limited to 'gcc/fortran/parse.c')
-rw-r--r-- | gcc/fortran/parse.c | 19 |
1 files changed, 16 insertions, 3 deletions
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)) { |