re PR fortran/68055 (ICE on using unsupported kinds in program without program statement)
authorSteven G. Kargl <kargl@gcc.gnu.org>
Sat, 24 Oct 2015 17:09:35 +0000 (17:09 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Sat, 24 Oct 2015 17:09:35 +0000 (17:09 +0000)
2015-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/68055
* decl.c (gfc_match_decl_type_spec): Check for valid kind in old-style
declarations.

2015-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/68055
* gfortran.dg/pr68055.f90: New case.

From-SVN: r229288

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr68055.f90 [new file with mode: 0644]

index 67d1fb0313ebb59598d8bc792fda703dc59f11fe..c65a69241848fcda31da45e1946cde38ba2ff7ab 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/68055
+       * decl.c (gfc_match_decl_type_spec): Check for valid kind in old-style
+       declarations.
+
 2015-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/67805
index 200a1287057ba73cb944fc7dca654d78dfba9994..651f1b0265de8a9e100b4c173a071d37ea41e056 100644 (file)
@@ -3021,7 +3021,11 @@ get_kind:
 
   m = gfc_match_kind_spec (ts, false);
   if (m == MATCH_NO && ts->type != BT_CHARACTER)
-    m = gfc_match_old_kind_spec (ts);
+    {
+      m = gfc_match_old_kind_spec (ts);
+      if (gfc_validate_kind (ts->type, ts->kind, true) == -1)
+         return MATCH_ERROR;
+    }
 
   if (matched_type && gfc_match_char (')') != MATCH_YES)
     return MATCH_ERROR;
index bd0281a02432871876b817c9234114efb4eddb18..212a67750a59998fd5ee38eb8c83a3949ea9a638 100644 (file)
@@ -1,3 +1,18 @@
+2015-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/68055
+       * gfortran.dg/pr68055.f90: New case.
+
+2015-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/67805
+       * gfortran.dg/pr67805.f90: New testcase.
+       * gfortran.dg/array_constructor_26.f03: Update testcase.
+       * gfortran.dg/array_constructor_27.f03: Ditto.
+       * gfortran.dg/char_type_len_2.f90: Ditto.
+       * gfortran.dg/pr67802.f90: Ditto.
+       * gfortran.dg/used_before_typed_3.f90: Ditto.
+
 2015-10-23  Jan Hubicka  <hubicka@ucw.cz>
 
        PR ipa/pr67600
diff --git a/gcc/testsuite/gfortran.dg/pr68055.f90 b/gcc/testsuite/gfortran.dg/pr68055.f90
new file mode 100644 (file)
index 0000000..c84a645
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do compile }
+! PR fortran/68055
+! Original code contributed by Gerhard Steinmetz
+! gerhard dot steinmetz dot fortran at t-online dot de
+! 
+   integer*3 c    ! { dg-error "not supported at" }
+   real*9 x       ! { dg-error "not supported at" }
+   logical*11 a   ! { dg-error "not supported at" }
+   complex*42 z   ! { dg-error "not supported at" }
+   c = 1
+   x = 1
+   call foo(a)
+end