aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/openmp.c
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2019-03-21 20:54:51 +0100
committerThomas Schwinge <tschwinge@gcc.gnu.org>2019-03-21 20:54:51 +0100
commit8ced98c6431c67b4f11b3eb4997b955b97472dc4 (patch)
tree49e5818fb5e5068922a4a583bef9c6d6a59d044f /gcc/fortran/openmp.c
parent64a40f1320c0edc160796266876958ffae8fdd96 (diff)
downloadgcc-8ced98c6431c67b4f11b3eb4997b955b97472dc4.zip
gcc-8ced98c6431c67b4f11b3eb4997b955b97472dc4.tar.gz
gcc-8ced98c6431c67b4f11b3eb4997b955b97472dc4.tar.bz2
[PR72741] The name in a Fortran OpenACC 'routine' directive refers to the containing subroutine or function
gcc/fortran/ PR fortran/72741 * openmp.c (gfc_match_oacc_routine): Clarify. gcc/testsuite/ PR fortran/72741 * gfortran.dg/goacc/routine-module-mod-1.f90: Update. From-SVN: r269856
Diffstat (limited to 'gcc/fortran/openmp.c')
-rw-r--r--gcc/fortran/openmp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 7a06eb5..1b1a0b4 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -2314,6 +2314,9 @@ gfc_match_oacc_routine (void)
if (st)
{
sym = st->n.sym;
+ /* If the name in a 'routine' directive refers to the containing
+ subroutine or function, then make sure that we'll later handle
+ this accordingly. */
if (gfc_current_ns->proc_name != NULL
&& strcmp (sym->name, gfc_current_ns->proc_name->name) == 0)
sym = NULL;