diff options
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-openmp.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/goacc/pr93464.f90 | 16 |
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4040ff2..eb8842b 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,12 @@ 2020-01-28 Tobias Burnus <tobias@codesourcery.com> + PR fortran/93464 + * openmp.c (gfc_omp_check_optional_argument): Avoid ICE when + DECL_LANG_SPECIFIC and GFC_DESCRIPTOR_TYPE_P but not + GFC_DECL_SAVED_DESCRIPTOR as for local allocatable character vars. + +2020-01-28 Tobias Burnus <tobias@codesourcery.com> + * gfortran.texi (Runtime): Remove tailing '.' in @menu. 2020-01-27 Tobias Burnus <tobias@codesourcery.com> diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index fd60bbb..6666955 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -101,7 +101,8 @@ gfc_omp_check_optional_argument (tree decl, bool for_present_check) decl = GFC_DECL_SAVED_DESCRIPTOR (decl); } - if (TREE_CODE (decl) != PARM_DECL + if (decl == NULL_TREE + || TREE_CODE (decl) != PARM_DECL || !DECL_LANG_SPECIFIC (decl) || !GFC_DECL_OPTIONAL_ARGUMENT (decl)) return NULL_TREE; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index eac1820..d9441cb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-01-28 Tobias Burnus <tobias@codesourcery.com> + + PR fortran/93464 + * gfortran.dg/goacc/pr93464.f90: New. + 2020-01-28 Richard Sandiford <richard.sandiford@arm.com> PR tree-optimization/93434 diff --git a/gcc/testsuite/gfortran.dg/goacc/pr93464.f90 b/gcc/testsuite/gfortran.dg/goacc/pr93464.f90 new file mode 100644 index 0000000..9221065 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/goacc/pr93464.f90 @@ -0,0 +1,16 @@ +! { dg-do compile } +! +! PR fortran/93464 +! +! Contributed by G. Steinmetz +! +program p + character :: c(2) = 'a' + character, allocatable :: z(:) + !$acc parallel + !$omp target + z = c + !$acc end parallel + !$omp end target + print *, z +end |