aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2019-10-11 17:59:09 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2019-10-11 17:59:09 +0000
commit95040e7e207dc0a2024c2ed10b8b15de4b369ece (patch)
tree8f70733c486c7065e27036658477ec7d39e849f5 /gcc/fortran/decl.c
parent405e87e8259b6e70bdf31544bb0e5d147e6f301a (diff)
downloadgcc-95040e7e207dc0a2024c2ed10b8b15de4b369ece.zip
gcc-95040e7e207dc0a2024c2ed10b8b15de4b369ece.tar.gz
gcc-95040e7e207dc0a2024c2ed10b8b15de4b369ece.tar.bz2
re PR fortran/91715 (ICE in resolve_fntype, at fortran/resolve.c:16884)
2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/91715 * decl.c (gfc_match_prefix): If matching a type-spec returns an error, it's an error so re-act correctly. 2019-10-11 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/91715 * gfortran.dg/function_kinds_5.f90: Prune run-on error. * gfortran.dg/pr85543.f90: Ditto. * gfortran.dg/pr91715.f90: New test. From-SVN: r276899
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 9b604c8..9cda824 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -6202,13 +6202,17 @@ gfc_match_prefix (gfc_typespec *ts)
found_prefix = true;
}
- if (!seen_type && ts != NULL
- && gfc_match_decl_type_spec (ts, 0) == MATCH_YES
- && gfc_match_space () == MATCH_YES)
+ if (!seen_type && ts != NULL)
{
-
- seen_type = true;
- found_prefix = true;
+ match m;
+ m = gfc_match_decl_type_spec (ts, 0);
+ if (m == MATCH_ERROR)
+ goto error;
+ if (m == MATCH_YES && gfc_match_space () == MATCH_YES)
+ {
+ seen_type = true;
+ found_prefix = true;
+ }
}
if (gfc_match ("elemental% ") == MATCH_YES)