aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/io.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2019-09-11 18:27:17 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2019-09-11 18:27:17 +0000
commit84e33251331478d41b1c05768ccf0d060ce5b242 (patch)
treee18f328b6545634658a698d4bfdc1d94f126e1b9 /gcc/fortran/io.c
parent19e057e7cc47115ea89f5d222baaae41e0084f50 (diff)
downloadgcc-84e33251331478d41b1c05768ccf0d060ce5b242.zip
gcc-84e33251331478d41b1c05768ccf0d060ce5b242.tar.gz
gcc-84e33251331478d41b1c05768ccf0d060ce5b242.tar.bz2
re PR fortran/91642 (ICE: Bad IO basetype (transfer_expr, at fortran/trans-io.c:2507))
2019-09-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/91642 * io.c (gfc_match_inquire): null() cannot be in an iolength inquire list. 2019-09-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/91642 * gfortran.dg/pr91642.f90: New test. From-SVN: r275655
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r--gcc/fortran/io.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c
index d57b747..bb64560 100644
--- a/gcc/fortran/io.c
+++ b/gcc/fortran/io.c
@@ -4641,6 +4641,17 @@ gfc_match_inquire (void)
if (m == MATCH_NO)
goto syntax;
+ for (gfc_code *c = code; c; c = c->next)
+ if (c->expr1 && c->expr1->expr_type == EXPR_FUNCTION
+ && c->expr1->symtree && c->expr1->symtree->n.sym->attr.function
+ && !c->expr1->symtree->n.sym->attr.external
+ && strcmp (c->expr1->symtree->name, "null") == 0)
+ {
+ gfc_error ("NULL() near %L cannot appear in INQUIRE statement",
+ &c->expr1->where);
+ goto cleanup;
+ }
+
new_st.op = EXEC_IOLENGTH;
new_st.expr1 = inquire->iolength;
new_st.ext.inquire = inquire;