diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2020-01-28 11:54:57 +0100 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2020-01-28 12:01:52 +0100 |
commit | 627d59b6b3062de921fbdd80b2b48de18f599d03 (patch) | |
tree | 95feb1da6c8e509fe570141d11a20468c7e342b4 /gcc/fortran/trans-openmp.c | |
parent | 1ee3b380dfb479b335f3b50039ce26abcbffe59a (diff) | |
download | gcc-627d59b6b3062de921fbdd80b2b48de18f599d03.zip gcc-627d59b6b3062de921fbdd80b2b48de18f599d03.tar.gz gcc-627d59b6b3062de921fbdd80b2b48de18f599d03.tar.bz2 |
[Fortran] avoid ICE in gfc_omp_check_optional_argument (PR93464)
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.
PR fortran/93464
* gfortran.dg/goacc/pr93464.f90: New.
Diffstat (limited to 'gcc/fortran/trans-openmp.c')
-rw-r--r-- | gcc/fortran/trans-openmp.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |