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 d000a1a..732b0f7 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 7eb0027..3e86a43 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 9613813..b326f18 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