aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2019-09-28 16:26:43 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2019-09-28 16:26:43 +0000
commit036aa59282d3084076e78216c6ba8e5291dc29f7 (patch)
treed0fa59374b514aa7638d05dd4f5dbb30cde863fe /gcc/fortran/match.c
parent406c9a1173f79dc0fb3231edb51690c1dd73f6a0 (diff)
downloadgcc-036aa59282d3084076e78216c6ba8e5291dc29f7.zip
gcc-036aa59282d3084076e78216c6ba8e5291dc29f7.tar.gz
gcc-036aa59282d3084076e78216c6ba8e5291dc29f7.tar.bz2
re PR fortran/91864 (ICE in gfc_check_do_variable, at fortran/parse.c:4405)
2019-09-28 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/91864 * gcc/fortran/io.c (match_io_element): An inquiry parameter cannot be read into. * gcc/fortran/match.c (gfc_match_allocate): An inquiry parameter can be neither an allocate-object nor stat variable. (gfc_match_deallocate): An inquiry parameter cannot be deallocated. 2019-09-28 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/91864 * gcc/testsuite/gfortran.dg/pr91864.f90 From-SVN: r276253
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 9b9dbf1..83b1189 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -4242,6 +4242,12 @@ gfc_match_allocate (void)
if (m == MATCH_ERROR)
goto cleanup;
+ if (tail->expr->expr_type == EXPR_CONSTANT)
+ {
+ gfc_error ("Unexpected constant at %C");
+ goto cleanup;
+ }
+
if (gfc_check_do_variable (tail->expr->symtree))
goto cleanup;
@@ -4374,6 +4380,12 @@ alloc_opt_list:
tmp = NULL;
saw_stat = true;
+ if (stat->expr_type == EXPR_CONSTANT)
+ {
+ gfc_error ("STAT tag at %L cannot be a constant", &stat->where);
+ goto cleanup;
+ }
+
if (gfc_check_do_variable (stat->symtree))
goto cleanup;
@@ -4650,6 +4662,12 @@ gfc_match_deallocate (void)
if (m == MATCH_NO)
goto syntax;
+ if (tail->expr->expr_type == EXPR_CONSTANT)
+ {
+ gfc_error ("Unexpected constant at %C");
+ goto cleanup;
+ }
+
if (gfc_check_do_variable (tail->expr->symtree))
goto cleanup;