re PR fortran/66044 (ICE on misplaced entry statement)
authorSteven G. Kargl <kargl@gcc.gnu.org>
Mon, 18 May 2015 22:06:48 +0000 (22:06 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Mon, 18 May 2015 22:06:48 +0000 (22:06 +0000)
2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/66044
* decl.c(gfc_match_entry):  Change a gfc_internal_error() into
a gfc_error()

2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/66044
* gfortran.dg/entry_21.f90: New test.

From-SVN: r223321

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

index 9da169462b791f0ebd1376092d1d07a503022f97..8f571b40b5505f5800563dafaa9b2046ad751b51 100644 (file)
@@ -1,3 +1,9 @@
+2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/66044
+       * decl.c(gfc_match_entry):  Change a gfc_internal_error() into
+       a gfc_error() 
+
 2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/66043
index 13002d45a1f03475013c9fc4eeb1fa979103dae9..f8d471aa3de5426e7d7d79f854a29ae947df2d82 100644 (file)
@@ -5592,7 +5592,7 @@ gfc_match_entry (void)
                       "a contained subprogram");
            break;
          default:
-           gfc_internal_error ("gfc_match_entry(): Bad state");
+           gfc_error ("Unexpected ENTRY statement at %C");
        }
       return MATCH_ERROR;
     }
index bda83a50ed93c3099bfa3705d51554f23cef945c..9f5c0ba49ee2b7304b444ca80351ff019e5d20f5 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/66044
+       * gfortran.dg/entry_21.f90: New test.
+
 2015-05-18  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/66043
diff --git a/gcc/testsuite/gfortran.dg/entry_21.f90 b/gcc/testsuite/gfortran.dg/entry_21.f90
new file mode 100644 (file)
index 0000000..999f2bd
--- /dev/null
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! PR fortran/66044
+!
+! Original code from Gerhard Steinmetz
+! <gerhard dot steinmetz dot fortran at t-online dot de>
+subroutine p
+end subroutine p
+
+entry e        ! { dg-error "Unexpected ENTRY statement" }
+end
+
+module m
+  type t
+      contains
+      entry e  ! { dg-error "Unexpected ENTRY statement" }
+  end type
+end module m