From 650f7d09d22fc876bdceb93a47d2abf068c676db Mon Sep 17 00:00:00 2001 From: Thomas Koenig Date: Sun, 24 Sep 2017 08:39:00 +0000 Subject: re PR fortran/80118 (ICE with zero size parameter array) 2017-09-24 Thomas Koenig Steven G. Kargl PR fortran/80118 * expr.c (gfc_get_full_arrayspec_from_expr): If there is no symtree, set array spec to NULL. 2017-09-24 Thomas Koenig Steven G. Kargl PR fortran/80118 * gfortran.dg/zero_sized_7.f90: New test. Co-Authored-By: Steven G. Kargl From-SVN: r253123 --- gcc/fortran/expr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/fortran/expr.c') diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 87ea09f..bfbb19e 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -4568,7 +4568,11 @@ gfc_get_full_arrayspec_from_expr (gfc_expr *expr) if (expr->expr_type == EXPR_VARIABLE || expr->expr_type == EXPR_CONSTANT) { - as = expr->symtree->n.sym->as; + if (expr->symtree) + as = expr->symtree->n.sym->as; + else + as = NULL; + for (ref = expr->ref; ref; ref = ref->next) { switch (ref->type) -- cgit v1.1