From: Steven G. Kargl Date: Wed, 19 Dec 2018 22:31:25 +0000 (+0000) Subject: re PR fortran/87992 (ICE in resolve_fl_variable, at fortran/resolve.c:12314) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d564142f580373ffd872de47a6a822d7b039252;p=gcc.git re PR fortran/87992 (ICE in resolve_fl_variable, at fortran/resolve.c:12314) 2018-12-19 Steven G. Kargl PR fortran/87992 * resolve.c (resolve_fl_variable): Avoid a NULL pointer. 2018-12-19 Steven G. Kargl PR fortran/87992 * gfortran.dg/pr87992.f90: New test. From-SVN: r267288 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 88acec1f38a..04eade51b47 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-12-19 Steven G. Kargl + + PR fortran/87992 + * resolve.c (resolve_fl_variable): Avoid a NULL pointer. + 2018-12-16 Steven G. Kargl * resolve.c (resolve_transfer): Remove dead code. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index fedf60ae770..9ce01c7dd42 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -12310,7 +12310,11 @@ resolve_fl_variable (gfc_symbol *sym, int mp_flag) { /* Make sure that character string variables with assumed length are dummy arguments. */ - e = sym->ts.u.cl->length; + if (sym->ts.u.cl) + e = sym->ts.u.cl->length; + else + return false; + if (e == NULL && !sym->attr.dummy && !sym->attr.result && !sym->ts.deferred && !sym->attr.select_type_temporary && !sym->attr.omp_udr_artificial_var) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 6a3ed92857e..bc8f8994d92 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-12-19 Steven G. Kargl + + PR fortran/87992 + * gfortran.dg/pr87992.f90: New test. + 2018-12-19 Uros Bizjak * gcc.target/i386/avx512dq-pr82855.c: Update scan-assembler pattern. diff --git a/gcc/testsuite/gfortran.dg/pr87992.f90 b/gcc/testsuite/gfortran.dg/pr87992.f90 new file mode 100644 index 00000000000..cbde0d011a0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr87992.f90 @@ -0,0 +1,5 @@ +! { dg-do compile } +subroutine s(x) + class(*), allocatable :: x + x = '' +end