re PR libfortran/20163 ([4.0 only] gfortran - error opening direct access file)
authorFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tue, 29 Mar 2005 08:37:32 +0000 (08:37 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Tue, 29 Mar 2005 08:37:32 +0000 (08:37 +0000)
PR libfortran/20163
* io/open.c (st_open): call library_end() before returning even if
an error arises.

* gfortran.dg/pr20163-2.f: New test.

From-SVN: r97153

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr20163-2.f [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/open.c

index 81ab1deb1fb40a55cee487d9b4565cdbbd65049b..73aa6eb1e1001997bccd72ebedd2a2a68b544ec8 100644 (file)
@@ -1,14 +1,14 @@
+2005-03-28  Steve Ellcey  <sje@cup.hp.com>
+
+       PR target/19890
+       * gcc.dg/20020219-1.c: Skip on IA64 HP-UX in ILP32 mode.
+
 2005-03-29  Dale Ranta  <dir@lanl.gov>
            Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        PR libfortran/20163
        * gfortran.dg/pr20163-2.f: New test.
 
-2005-03-28  Steve Ellcey  <sje@cup.hp.com>
-
-       PR target/19890
-       * gcc.dg/20020219-1.c: Skip on IA64 HP-UX in ILP32 mode.
-
 2005-03-28  Jan Hubicka  <jh@suse.cz>
 
        PR middle-end/20635
diff --git a/gcc/testsuite/gfortran.dg/pr20163-2.f b/gcc/testsuite/gfortran.dg/pr20163-2.f
new file mode 100644 (file)
index 0000000..c0b2573
--- /dev/null
@@ -0,0 +1,5 @@
+       open(10,status="foo",err=100)
+       call abort
+  100  continue
+       open(10,status="scratch")
+       end
index 32b5454827bfef62696ec44c36e4936851740b4a..edc23af6ce93413c55e5de925c09203bf2b9fb03 100644 (file)
@@ -1,3 +1,10 @@
+2005-03-29  Dale Ranta  <dir@lanl.gov>
+           Francois-Xavier Coudert  <coudert@clipper.ens.fr>
+
+       PR libfortran/20163
+       * io/open.c (st_open): call library_end() before returning even if
+       an error arises.
+
 2005-03-25  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
 
        PR libfortran/19678
index 3d0e5bebe7af97b016fb03aaac26dd2d2ed8e90d..82a862b7c47aabe97d437548e81939148decfd6d 100644 (file)
@@ -481,7 +481,10 @@ st_open (void)
     flags.position = POSITION_ASIS;
 
   if (ioparm.library_return != LIBRARY_OK)
+  {
+    library_end ();
     return;
+  }
 
   u = find_unit (ioparm.unit);