From 19adb97a310cd398814c5ccb75580b1658433cfc Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Sun, 16 Dec 2018 03:33:05 +0000 Subject: re PR fortran/87994 (ICE in match_data_constant, at fortran/decl.c:399) 2018-12-15 Steven G. Kargl PR fortran/87944 * decl.c (match_data_constant): Allow inquiry parameter as data constant in data statement. 2018-12-15 Steven G. Kargl PR fortran/87944 * gfortran.dg/pr87994_1.f90: New test. * gfortran.dg/pr87994_2.f90: Ditto. * gfortran.dg/pr87994_3.f90: Ditto. From-SVN: r267184 --- gcc/fortran/decl.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/fortran/decl.c') diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 78555ce..1dd3225 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -399,6 +399,14 @@ match_data_constant (gfc_expr **result) } else if (m == MATCH_YES) { + /* If a parameter inquiry ends up here, symtree is NULL but **result + contains the right constant expression. Check here. */ + if ((*result)->symtree == NULL + && (*result)->expr_type == EXPR_CONSTANT + && ((*result)->ts.type == BT_INTEGER + || (*result)->ts.type == BT_REAL)) + return m; + /* F2018:R845 data-stmt-constant is initial-data-target. A data-stmt-constant shall be ... initial-data-target if and only if the corresponding data-stmt-object has the POINTER -- cgit v1.1