From 2f2fc3252c04fbd51de8d0ff95bb85e2049f0887 Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 8 Jun 2018 19:11:21 +0000 Subject: re PR fortran/86059 (ICE in reduce_binary_ac, at fortran/arith.c:1308 (and others)) 2018-06-08 Steven G. Kargl PR fortran/86059 * array.c (match_array_cons_element): NULL() cannot be in an array constructor. 2018-06-08 Steven G. Kargl PR fortran/86059 * gfortran.dg/associate_30.f90: Remove code tested ... * gfortran.dg/pr67803.f90: Ditto. * gfortran.dg/pr67805.f90: Ditto. * gfortran.dg/pr86059.f90: ... here. New test. From-SVN: r261344 --- gcc/fortran/array.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/fortran/array.c') diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 36b809e..031ab76 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -1098,6 +1098,15 @@ match_array_cons_element (gfc_constructor_base *result) if (m != MATCH_YES) return m; + if (expr->expr_type == EXPR_FUNCTION + && expr->ts.type == BT_UNKNOWN + && strcmp(expr->symtree->name, "null") == 0) + { + gfc_error ("NULL() at %C cannot appear in an array constructor"); + gfc_free_expr (expr); + return MATCH_ERROR; + } + gfc_constructor_append_expr (result, expr, &gfc_current_locus); return MATCH_YES; } -- cgit v1.1