Bug 25828 - [f2003] ACCESS='STREAM' io support
[f2003] ACCESS='STREAM' io support
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: fortran
4.2.0
: P3 enhancement
: 4.2.0
Assigned To: Jerry DeLisle
http://gcc.gnu.org/ml/gcc-patches/200...
: patch
Depends on: 25561
Blocks: 20585
  Show dependency treegraph
 
Reported: 2006-01-17 21:48 UTC by Janne Blomqvist
Modified: 2006-08-16 03:14 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-07-12 02:14:27


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janne Blomqvist 2006-01-17 21:48:12 UTC
ACCESS='STREAM' is IO without any record structure, i.e. it's similar to how IO is done in C and many other languages.
Comment 1 Andrew Pinski 2006-01-17 23:33:22 UTC
Confirmed.
Comment 2 Jerry DeLisle 2006-07-03 23:14:37 UTC
Since I do not have access to an F2003 compiler and have not used this feature, could someone post an example program using this feature that is "known to work" that I can then use as a working test case.

I am going to start piecing this together.  Janne I will forward things to you for review off list if thats OK.
Comment 3 Jerry DeLisle 2006-07-12 02:14:26 UTC
I have the beginnings of a patch now with unformatted read and write working and formatted write working.  Still need to do formatted read and checking of all constraints.  It appears to me that this is progressing OK.
Comment 4 patchapp@dberlin.org 2006-08-03 06:05:16 UTC
Subject: Bug number PR25828

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-08/msg00056.html
Comment 5 patchapp@dberlin.org 2006-08-10 04:35:16 UTC
Subject: Bug number PR25828

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-08/msg00300.html
Comment 6 Jerry DeLisle 2006-08-15 23:03:38 UTC
Subject: Bug 25828

Author: jvdelisle
Date: Tue Aug 15 23:03:28 2006
New Revision: 116171

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

	PR fortran/25828
	* gfortran.h: Add new pointer for stream position to st_inquire.
	Rename gfc_large_io_int_kind to gfc_intio_kind.
	* trans-types.c (gfc_init_kinds): use gfc_intio_kind.
	* io.c: Add new IO tag for file position going in and another for out.
	(match_dt_element): Match new tag_spos.
	(gfc_resolve_dt): Resolve new tag_spos.
	(gfc_free_inquire): Free inquire->strm_pos.
	(match_inquire_element): Match new tag_strm_out.
	(gfc_resolve_inquire): Resolve new tag_strm_out.
	* trans-io.c: Rename IOPARM_type_large_io_int to IOPARM_type_intio.
	(gfc_build_st_parameter): Same.
	(gfc_build_io_library_fndecls) Same. and add build pointer type pintio.
	(gfc_trans_inquire): Translate strm_pos for inquire.
	* ioparm.def: Reorder flags to accomodate addition of new inquire
	flag for strm_pos_out and add it in.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/io.c
    trunk/gcc/fortran/ioparm.def
    trunk/gcc/fortran/trans-io.c
    trunk/gcc/fortran/trans-types.c

Comment 7 Jerry DeLisle 2006-08-15 23:06:53 UTC
Subject: Bug 25828

Author: jvdelisle
Date: Tue Aug 15 23:06:44 2006
New Revision: 116172

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

	PR libgfortran/25828
	* libgfortran.h: Rename GFC_LARGE_IO_INT to GFC_IO_INT.
	* io/file_pos.c (st_backspace): Ignore if access=STREAM.
	(st_rewind): Handle case of access=STREAM.
	* io/open.c (access_opt): Add STREAM_ACCESS.
	(edit_modes): Set current_record to zero only if not STREAM.
	(new_unit): Initialize maxrec, recl, and last_record for STREAM.
	* io/read.c (read_x): Advance file position for STREAM.
	* io/io.h (enum unit_access): Align IOPARM flags with frontend.
	Add ACCESS_STREAM. Add prototype for is_stream_io () function.
	Use GFC_IO_INT.
	* io/inquire.c (inquire_via_unit): Add text for access = "STREAM".
	* io/unit.c (is_stream_io): New function to return true if access =
	STREAM.
	* io/transfer.c (file_mode): Add modes for unformatted stream and
	formatted stream. (current_mode): Return appropriate file mode based
	on access flags.
	(read_block): Handle formatted stream reads.
	(read_block_direct): Handle unformatted stream reads.
	(write_block): Handle formatted stream writes.
	(write_buf): Handle unformatted stream writes.
	(unformatted_read): Fix up, use temporary for size.
	(pre_position): Position file for STREAM access.
	(data_transfer_init): Initialize for stream access, skip irrelevent
	error checks.
	(next_record_r),(next_record_w), and (next_record): Do nothing for
	stream I/O.
	(finalize_transfer): Flush when all done if stream I/O.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/file_pos.c
    trunk/libgfortran/io/inquire.c
    trunk/libgfortran/io/io.h
    trunk/libgfortran/io/open.c
    trunk/libgfortran/io/read.c
    trunk/libgfortran/io/transfer.c
    trunk/libgfortran/io/unit.c
    trunk/libgfortran/libgfortran.h

Comment 8 Jerry DeLisle 2006-08-15 23:14:11 UTC
Subject: Bug 25828

Author: jvdelisle
Date: Tue Aug 15 23:14:03 2006
New Revision: 116173

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

	PR fortran/25828
	* gfortran.dg/streamio_1.f90: New test.
	* gfortran.dg/streamio_2.f90: New test.
	* gfortran.dg/streamio_3.f90: New test.
	* gfortran.dg/streamio_4.f90: New test.
	* gfortran.dg/streamio_5.f90: New test.
	* gfortran.dg/streamio_6.f90: New test.
	* gfortran.dg/streamio_7.f90: New test.
	* gfortran.dg/streamio_8.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/streamio_1.f90
    trunk/gcc/testsuite/gfortran.dg/streamio_2.f90
    trunk/gcc/testsuite/gfortran.dg/streamio_3.f90
    trunk/gcc/testsuite/gfortran.dg/streamio_4.f90
    trunk/gcc/testsuite/gfortran.dg/streamio_5.f90
    trunk/gcc/testsuite/gfortran.dg/streamio_6.f90
    trunk/gcc/testsuite/gfortran.dg/streamio_7.f90
    trunk/gcc/testsuite/gfortran.dg/streamio_8.f90
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 9 Jerry DeLisle 2006-08-16 03:14:31 UTC
Fixed on 4.2.  Will not go to 4.1
Comment 10 Janne Blomqvist 2006-08-20 09:22:48 UTC
Subject: Bug 25828

Author: jb
Date: Sun Aug 20 09:22:04 2006
New Revision: 116271

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116271
Log:
2006-08-20  Janne Blomqvist  <jb@gcc.gnu.org>

	PR fortran/25828
	* gfortran.texi: Mention STREAM I/O among supported F2003
	features.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.texi