re PR fortran/85703 ([openacc] ICE in resolve_fntype, at fortran/resolve.c:16313)
authorCesar Philippidis <cesar@codesourcery.com>
Wed, 13 Jun 2018 14:31:17 +0000 (07:31 -0700)
committerCesar Philippidis <cesar@gcc.gnu.org>
Wed, 13 Jun 2018 14:31:17 +0000 (07:31 -0700)
PR fortran/85703

gcc/fortran/
* parse.c (decode_oacc_directive): Set gfc_matching_function
to false.
(decode_omp_directive): Likewise.

gcc/testsuite/
* gfortran.dg/goacc/pr85703.f90: New test.
* gfortran.dg/gomp/pr85703.f90: New test.

From-SVN: r261551

gcc/fortran/ChangeLog
gcc/fortran/parse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/goacc/pr85703.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/pr85703.f90 [new file with mode: 0644]

index 9018933e6971f3672758f76b9411e24b4b09a5d9..25b5f37de5511b95b74c4abe0067609375f43125 100644 (file)
@@ -1,3 +1,10 @@
+2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
+
+       PR fortran/85703
+       * parse.c (decode_oacc_directive): Set gfc_matching_function
+       to false.
+       (decode_omp_directive): Likewise.
+
 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
 
        PR fortran/85702
index a3693a192f0e3085b839ce2ffa65276d27254aeb..4ce6eb427506f8fa5ee8311d9b584770ef07249b 100644 (file)
@@ -624,6 +624,8 @@ decode_oacc_directive (void)
   gfc_clear_error ();   /* Clear any pending errors.  */
   gfc_clear_warning (); /* Clear any pending warnings.  */
 
+  gfc_matching_function = false;
+
   if (gfc_pure (NULL))
     {
       gfc_error_now ("OpenACC directives at %C may not appear in PURE "
@@ -795,6 +797,8 @@ decode_omp_directive (void)
   gfc_clear_error ();  /* Clear any pending errors.  */
   gfc_clear_warning ();        /* Clear any pending warnings.  */
 
+  gfc_matching_function = false;
+
   if (gfc_current_state () == COMP_FUNCTION
       && gfc_current_block ()->result->ts.kind == -1)
     spec_only = true;
index 13a18bac08ba8dbbdb874bacb545f5a560140458..c56ef09f72694e9b809fd33042fbbf33b36cadc3 100644 (file)
@@ -1,3 +1,9 @@
+2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
+
+       PR fortran/85703
+       * gfortran.dg/goacc/pr85703.f90: New test.
+       * gfortran.dg/gomp/pr85703.f90: New test.
+
 2018-06-13  Cesar Philippidis  <cesar@codesourcery.com>
 
        PR fortran/85702
diff --git a/gcc/testsuite/gfortran.dg/goacc/pr85703.f90 b/gcc/testsuite/gfortran.dg/goacc/pr85703.f90
new file mode 100644 (file)
index 0000000..d9de1a3
--- /dev/null
@@ -0,0 +1,9 @@
+! PR fortran/85703
+! { dg-do compile }
+
+character function f()
+  !$acc parallel loop reduction(+:a)
+  do i = 1, 4
+  end do
+  !$acc end parallel loop
+end
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr85703.f90 b/gcc/testsuite/gfortran.dg/gomp/pr85703.f90
new file mode 100644 (file)
index 0000000..7ca2b93
--- /dev/null
@@ -0,0 +1,8 @@
+! PR fortran/85703
+! { dg-do compile }
+
+character function f()
+  !$omp single
+  !$omp end single
+  f = 'a'
+end