public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-8321] Fortran/OpenMP: Fix var-list expr parsing with array/dt
@ 2021-04-29  6:49 Tobias Burnus
  0 siblings, 0 replies; only message in thread
From: Tobias Burnus @ 2021-04-29  6:49 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b6c6d7947759255dd9d1c8cac31f9aa423b020e7

commit r11-8321-gb6c6d7947759255dd9d1c8cac31f9aa423b020e7
Author: Tobias Burnus <tobias@codesourcery.com>
Date:   Wed Apr 28 22:35:06 2021 +0200

    Fortran/OpenMP: Fix var-list expr parsing with array/dt
    
    gcc/fortran/ChangeLog:
    
            * openmp.c (gfc_match_omp_variable_list): Gobble whitespace before
            checking whether a '%' or parenthesis-open follows as next character.
    
    gcc/testsuite/ChangeLog:
    
            * gfortran.dg/gomp/map-5.f90: New test.
    
    (cherry picked from commit e4aefface2a0e34d84b85844b11652eb28f2cf0c)

Diff:
---
 gcc/fortran/openmp.c                     |  1 +
 gcc/testsuite/gfortran.dg/gomp/map-5.f90 | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 1f1920cf0e1..8e4527bfbc6 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -261,6 +261,7 @@ gfc_match_omp_variable_list (const char *str, gfc_omp_namelist **list,
 	case MATCH_YES:
 	  gfc_expr *expr;
 	  expr = NULL;
+	  gfc_gobble_whitespace ();
 	  if ((allow_sections && gfc_peek_ascii_char () == '(')
 	      || (allow_derived && gfc_peek_ascii_char () == '%'))
 	    {
diff --git a/gcc/testsuite/gfortran.dg/gomp/map-5.f90 b/gcc/testsuite/gfortran.dg/gomp/map-5.f90
new file mode 100644
index 00000000000..2b4b341bc51
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/map-5.f90
@@ -0,0 +1,13 @@
+implicit none
+type t
+  integer :: b(5)
+end type t
+integer :: a(5), x, y(5)
+type(t) :: b
+!$omp target enter data map( to: a (:) )
+!$omp target enter data map( to: b % b )
+!$omp target enter data map( to: a(:) )
+!$omp target depend(out: y (2)) nowait
+!$omp end target
+
+end


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

only message in thread, other threads:[~2021-04-29  6:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29  6:49 [gcc r11-8321] Fortran/OpenMP: Fix var-list expr parsing with array/dt 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).