]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
OpenMP/Fortran: Fix parsing of metadirectives with BLOCK
authorTobias Burnus <tobias@codesourcery.com>
Tue, 31 Oct 2023 11:03:44 +0000 (12:03 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Tue, 31 Oct 2023 11:03:44 +0000 (12:03 +0100)
Probably a fallout of the backport of r14-4471-g6a8edd50a149f1
  Fortran/OpenMP: Fix handling of strictly structured blocks
This showed up as parsing error/fail with
 libgomp.fortran/metadirective-1.f90
 libgomp.fortran/metadirective-6.f90

gcc/fortran/

* decl.cc (gfc_match_end): Handle unnamed END BLOCK with
metadirectives.

gcc/fortran/ChangeLog.omp
gcc/fortran/decl.cc

index 6b30302428f36fa92d1fcbdd7c0a22042aa1060e..e20a88b87408f66c673750b5bb3bd17bf1fd9ef7 100644 (file)
@@ -1,3 +1,8 @@
+2023-10-31  Tobias Burnus  <tobias@codesourcery.com>
+
+       * decl.cc (gfc_match_end): Handle unnamed END BLOCK with
+       metadirectives.
+
 2023-10-30  Tobias Burnus  <tobias@codesourcery.com>
 
        * trans-openmp.cc (gfc_trans_omp_clauses): Avoid gfc_evaluate_now
index 783c39438e868ca2a4868c5113ffe132b8794e30..4c04e64d37cf2bea04638a302d9e0ac042aa6c94 100644 (file)
@@ -8409,6 +8409,9 @@ gfc_match_end (gfc_statement *st)
                && state_data->sym->abr_modproc_decl;
        }
        while (state == COMP_OMP_METADIRECTIVE);
+
+       if (startswith (block_name, "block@"))
+         block_name = NULL;
       }
       break;
     default: