re PR fortran/38252 (Empty function with CONTAINS triggers Internal Error)
authorMikael Morin <mikael.morin@tele2.fr>
Mon, 1 Dec 2008 19:30:55 +0000 (20:30 +0100)
committerMikael Morin <mikael@gcc.gnu.org>
Mon, 1 Dec 2008 19:30:55 +0000 (19:30 +0000)
2008-12-01  Mikael Morin  <mikael.morin@tele2.fr>

PR fortran/38252
* parse.c (parse_spec): Skip statement order check in case
of a CONTAINS statement.

2008-12-01  Mikael Morin  <mikael.morin@tele2.fr>

PR fortran/38252
* gfortran.dg/empty_function_1.f90: New test.

From-SVN: r142327

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

index d000a1ac513d177dcd33b5b21d44a21bb4c3926e..732b0f7a497e094b70c14153979d9ea97d511feb 100644 (file)
@@ -1,3 +1,9 @@
+2008-12-01  Mikael Morin  <mikael.morin@tele2.fr>
+
+       PR fortran/38252
+       * parse.c (parse_spec): Skip statement order check in case
+       of a CONTAINS statement.
+
 2008-11-30  Daniel Kraft  <d@domob.eu>
 
        PR fortran/37779
index 7eb002780533c777022883d0236604794711bad5..3e86a43d0b13f4383c002c1be2ce2ef5ed528ed4 100644 (file)
@@ -2338,7 +2338,7 @@ loop:
     {
       bool verify_now = false;
 
-      if (st == ST_END_FUNCTION)
+      if (st == ST_END_FUNCTION || st == ST_CONTAINS)
        verify_now = true;
       else
        {
index 96138130093e561944a7dbc1e2c2915e11d337c8..b326f1895f1a7b1ebf46002d29c944b8d2574106 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-01  Mikael Morin  <mikael.morin@tele2.fr>
+
+       PR fortran/38252
+       * gfortran.dg/empty_function_1.f90: New test.
+
 2008-12-01  Uros Bizjak  <ubizjak@gmail.com>
 
        PR rtl-optimization/33642
diff --git a/gcc/testsuite/gfortran.dg/empty_function_1.f90 b/gcc/testsuite/gfortran.dg/empty_function_1.f90
new file mode 100644 (file)
index 0000000..a9cc185
--- /dev/null
@@ -0,0 +1,30 @@
+! { dg-do compile }
+!
+! PR fortran/38252
+! FUNCTION rejected if both specification and execution part are empty
+!
+! Contributed by Daniel Kraft <d@domob.eu>
+
+INTEGER FUNCTION test ()
+CONTAINS
+END FUNCTION test
+! { dg-do compile }
+!
+! PR fortran/38252
+! FUNCTION rejected if both specification and execution part are empty
+!
+! Contributed by Daniel Kraft <d@domob.eu>
+
+INTEGER FUNCTION test ()
+CONTAINS
+END FUNCTION test
+! { dg-do compile }
+!
+! PR fortran/38252
+! FUNCTION rejected if both specification and execution part are empty
+!
+! Contributed by Daniel Kraft <d@domob.eu>
+
+INTEGER FUNCTION test ()
+CONTAINS
+END FUNCTION test