https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71704
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Thu Jul 7 12:50:01 2016 New Revision: 238103 URL: https://gcc.gnu.org/viewcvs?rev=238103&root=gcc&view=rev Log: Backported from mainline 2016-06-30 Jakub Jelinek <ja...@redhat.com> PR fortran/71704 * parse.c (matchs, matcho): Move right before decode_omp_directive. If spec_only, only gfc_match the keyword and if successful, goto do_spec_only. (matchds, matchdo): Define. (decode_omp_directive): Add spec_only local var and set it. Use matchds or matchdo macros instead of matchs or matcho for declare target, declare simd, declare reduction and threadprivate directives. Return ST_GET_FCN_CHARACTERISTICS if a non-declarative directive could be matched. (next_statement): For ST_GET_FCN_CHARACTERISTICS restore gfc_current_locus from old_locus even if there is no label. * gfortran.dg/gomp/pr71704.f90: New test. Added: branches/gcc-5-branch/gcc/testsuite/gfortran.dg/gomp/pr71704.f90 Modified: branches/gcc-5-branch/gcc/fortran/ChangeLog branches/gcc-5-branch/gcc/fortran/parse.c branches/gcc-5-branch/gcc/testsuite/ChangeLog