https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542

--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Thu, Apr 26, 2018 at 06:47:34PM +0000, kargl at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85542
> 
> --- Comment #2 from kargl at gcc dot gnu.org ---
> (In reply to G. Steinmetz from comment #0)
> > gfortran-8 changed between 20180304 and 20180311.
> > gfortran-7 changed between 20180215 and 20180308.
> > gfortran-6 changed between 20180307 and 20180314.
> > 
> > 
> > $ cat z1.f90
> > function f(x)
> >    character(*), intent(in) :: x
> >    character((len((x)))) :: f
> >    f = x
> > end
> > 
> 
> Workaround: remove superfluous parentheses.
> 

Pesky NULL pointers.

Index: gcc/fortran/expr.c
===================================================================
--- gcc/fortran/expr.c  (revision 259653)
+++ gcc/fortran/expr.c  (working copy)
@@ -2422,7 +2422,7 @@ check_inquiry (gfc_expr *e, int not_restricted)

        /* Assumed character length will not reduce to a constant expression
           with LEN, as required by the standard.  */
-       if (i == 5 && not_restricted
+       if (i == 5 && not_restricted && ap->expr->symtree
            && ap->expr->symtree->n.sym->ts.type == BT_CHARACTER
            && (ap->expr->symtree->n.sym->ts.u.cl->length == NULL
                || ap->expr->symtree->n.sym->ts.deferred))

Reply via email to