re PR libfortran/16935 (Segmentation fault of compiler with unsupported control items...
authorBud Davis <bdavis9659@comcast.net>
Fri, 13 Aug 2004 22:01:02 +0000 (22:01 +0000)
committerBud Davis <bdavis@gcc.gnu.org>
Fri, 13 Aug 2004 22:01:02 +0000 (22:01 +0000)
2004-08-13  Bud Davis  <bdavis9659@comcast.net>

        PR gfortran/13965
        * gfortran.fortran-torture/execute/open_rewind.f90: New test.
        * io/open.c (st_open): use flags instead of the unit structure.

From-SVN: r85966

gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/pr16935.f90 [new file with mode: 0644]
libgfortran/ChangeLog
libgfortran/io/open.c

index ad541935f08230d3002cffaf7192535a483dad23..c3cafd2afa32c25c696266a5c4315c3e093aa699 100644 (file)
@@ -1,3 +1,7 @@
+2004-08-13  Bud Davis  <bdavis9659@comcast.net>
+
+       * gfortran.fortran-torture/execute/open_rewind.f90: New test.
+
 2004-08-13  Janis Johnson  <janis187@us.ibm.com>
 
        * g++.dg/ext/altivec-2.C: Revert previous changes and don't execute.
diff --git a/gcc/testsuite/gfortran.dg/pr16935.f90 b/gcc/testsuite/gfortran.dg/pr16935.f90
new file mode 100644 (file)
index 0000000..63f5400
--- /dev/null
@@ -0,0 +1,7 @@
+! { dg-do run }
+! pr16935
+! segfault at run time on open statement
+       program bug2
+       implicit none
+       open( 1 , file = "str_500.txt", position = "REWIND" )
+       end
index c6f1a8df05d0dcbcd434521fa1a810cffd97144c..e622e3155bdc7f98d7478e20ea3a722dd50f5126 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-13  Bud Davis  <bdavis9659@comcast.net>
+
+       PR gfortran/13965
+       * io/open.c (st_open): use flags instead of the unit structure.
+
 2004-08-10  Victor Leikehman  <lei@il.ibm.com>
 
        * io/list_read.c (namelist_read): Convert variable names
index cd70622baf7673fab9a1268f93498eb31082cd0d..f88bdeccf59f31f8a67c1d8ac50e8e0a36cc8a4b 100644 (file)
@@ -506,8 +506,8 @@ st_open (void)
   if (ioparm.unit < 0)
     generate_error (ERROR_BAD_OPTION, "Bad unit number in OPEN statement");
 
-  if (flags.position != POSITION_UNSPECIFIED &&
-      u->flags.access == ACCESS_DIRECT)
+  if (flags.position != POSITION_UNSPECIFIED
+      && flags.access == ACCESS_DIRECT)
     generate_error (ERROR_BAD_OPTION,
                    "Cannot use POSITION with direct access files");