Bug 27704 - Incorrect runtime error on multiple OPEN
Summary: Incorrect runtime error on multiple OPEN
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-21 16:24 UTC by Jerry DeLisle
Modified: 2006-07-12 02:17 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-06-28 05:48:53


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jerry DeLisle 2006-05-21 16:24:00 UTC
The following should not produce a runtime error.

       
       OPEN(8, FORM = 'unformatted', STATUS = 'scratch')
       OPEN(8, FORM = 'unformatted', STATUS = 'scratch')
       end

There may be other combinations of arguments to open that should not error,

See the following thread:

http://gcc.gnu.org/ml/fortran/2006-05/msg00307.html
Comment 1 Jerry DeLisle 2006-06-28 05:48:53 UTC
If anyone else has started on this, let me know.
Comment 2 patchapp@dberlin.org 2006-07-01 05:20:14 UTC
Subject: Bug number PR27704

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00006.html
Comment 3 Jerry DeLisle 2006-07-04 01:36:40 UTC
Subject: Bug 27704

Author: jvdelisle
Date: Tue Jul  4 01:36:31 2006
New Revision: 115168

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115168
Log:
2006-07-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/27704
	* runtime/error.c (notify_std): Pass common flags into function. Use
	flags to show locus of error or warning.
	* libgfortran.h: Add enum try.  Add prototype for notify_std.
	* io/open.c (edit_modes): Allow status="old" and add extension to
	allow status="scratch"
	*io/list_read.c (nml_read_obj): Update call to notify_std.
	*io/io.h: Remove enum try and prototype for notify_std.
	*io/transfer.c (read_sf): Update call to notify_std.
	*io/format.c (parse_format_list): Update call to notify_std.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/format.c
    trunk/libgfortran/io/io.h
    trunk/libgfortran/io/list_read.c
    trunk/libgfortran/io/open.c
    trunk/libgfortran/io/transfer.c
    trunk/libgfortran/libgfortran.h
    trunk/libgfortran/runtime/error.c

Comment 4 Jerry DeLisle 2006-07-04 01:47:35 UTC
Subject: Bug 27704

Author: jvdelisle
Date: Tue Jul  4 01:47:26 2006
New Revision: 115169

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115169
Log:
2006-07-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/27704
	* gfortran.dg/open_status_3.f90: New test.
	* gfortran.dg/fmt_l.f90: Update for new feature.

Added:
    trunk/gcc/testsuite/gfortran.dg/open_status_3.f90
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/fmt_l.f90

Comment 5 Jerry DeLisle 2006-07-12 02:16:50 UTC
Fixed on 4.2 only.  If someone wants this on 4.1 let me know.