public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/omp/gcc-13] OpenMP/Fortran: Fix parsing of metadirectives with BLOCK
@ 2023-10-31 11:03 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2023-10-31 11:03 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:46feedaddf8e4d82b7a24557c7bb4c8c3ee287a0

commit 46feedaddf8e4d82b7a24557c7bb4c8c3ee287a0
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Tue Oct 31 12:03:44 2023 +0100

    OpenMP/Fortran: Fix parsing of metadirectives with BLOCK
    
    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.

Diff:
---
 gcc/fortran/ChangeLog.omp | 5 +++++
 gcc/fortran/decl.cc       | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/gcc/fortran/ChangeLog.omp b/gcc/fortran/ChangeLog.omp
index 6b30302428f3..e20a88b87408 100644
--- a/gcc/fortran/ChangeLog.omp
+++ b/gcc/fortran/ChangeLog.omp
@@ -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
diff --git a/gcc/fortran/decl.cc b/gcc/fortran/decl.cc
index 783c39438e86..4c04e64d37cf 100644
--- a/gcc/fortran/decl.cc
+++ b/gcc/fortran/decl.cc
@@ -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:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-31 11:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-31 11:03 [gcc/devel/omp/gcc-13] OpenMP/Fortran: Fix parsing of metadirectives with BLOCK Tobias Burnus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).