From: Cesar Philippidis Date: Wed, 13 Jun 2018 14:31:17 +0000 (-0700) Subject: re PR fortran/85703 ([openacc] ICE in resolve_fntype, at fortran/resolve.c:16313) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0be606d3ce7b39148d0d0aed54bae3b4fe9478af;p=gcc.git re PR fortran/85703 ([openacc] ICE in resolve_fntype, at fortran/resolve.c:16313) 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 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9018933e697..25b5f37de55 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2018-06-13 Cesar Philippidis + + PR fortran/85703 + * parse.c (decode_oacc_directive): Set gfc_matching_function + to false. + (decode_omp_directive): Likewise. + 2018-06-13 Cesar Philippidis PR fortran/85702 diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c index a3693a192f0..4ce6eb42750 100644 --- a/gcc/fortran/parse.c +++ b/gcc/fortran/parse.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 13a18bac08b..c56ef09f726 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-06-13 Cesar Philippidis + + PR fortran/85703 + * gfortran.dg/goacc/pr85703.f90: New test. + * gfortran.dg/gomp/pr85703.f90: New test. + 2018-06-13 Cesar Philippidis 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 index 00000000000..d9de1a3971f --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/pr85703.f90 @@ -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 index 00000000000..7ca2b93ffb1 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/pr85703.f90 @@ -0,0 +1,8 @@ +! PR fortran/85703 +! { dg-do compile } + +character function f() + !$omp single + !$omp end single + f = 'a' +end