Bug 22390 - Implement FLUSH statement
Implement FLUSH statement
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: fortran
4.1.0
: P2 enhancement
: 4.1.0
Assigned To: Janne Blomqvist
:
Depends on:
Blocks: 20585
  Show dependency treegraph
 
Reported: 2005-07-09 19:40 UTC by Janne Blomqvist
Modified: 2005-08-23 01:53 UTC (History)
1 user (show)

See Also:
Host:
Target: 4.1.0
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-07-09 19:42:03


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Janne Blomqvist 2005-07-09 19:40:52 UTC
Fortran 2003 defines the FLUSH statement (semantics same as for the other file
positioning statements BACKSPACE, REWIND, ENDFILE).

Note that gfortran already provides a flush intrinsic subroutine and function
(g77 compatibility).
Comment 1 Andrew Pinski 2005-07-09 19:42:03 UTC
Confirmed.
Comment 2 Janne Blomqvist 2005-07-11 05:55:36 UTC
Proposed patch here: http://gcc.gnu.org/ml/gcc-patches/2005-07/msg00698.html
Comment 3 CVS Commits 2005-08-07 22:56:26 UTC
Subject: Bug 22390

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	kargl@gcc.gnu.org	2005-08-07 22:56:20

Modified files:
	gcc/fortran    : ChangeLog dump-parse-tree.c gfortran.h io.c 
	                 match.c match.h parse.c resolve.c st.c 
	                 trans-io.c trans-stmt.h trans.c 
	libgfortran    : ChangeLog Makefile.am Makefile.in 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: flush_1.f90 

Log message:
	2005-08-07   Janne Blomqvist <jblomqvi@cc.hut.fi>
	
	PR fortran/22390
	* dump-parse-tree.c (gfc_show_code_node): Add case for FLUSH.
	* gfortran.h: Add enums for FLUSH.
	* io.c (gfc_free_filepos,match_file_element,match_filepos): Modify
	comment appropriately.  (gfc_match_flush): New function.
	* match.c (gfc_match_if): Add match for flush.
	* match.h: Add prototype.
	* parse.c (decode_statement): Add flush to 'f' case.
	(next_statement): Add case for flush. (gfc_ascii_statement): Likewise.
	* resolve.c (resolve_code): Add flush case.
	* st.c (gfc_free_statement): Add flush case.
	* trans-io.c: Add prototype for flush.
	(gfc_build_io_library_fndecls): Build fndecl for flush.
	(gfc_trans_flush): New function.
	* trans-stmt.h: Add prototype.
	* trans.c (gfc_trans_code): Add case for flush.
	
	2005-08-07  Janne Blomqvist  <jblomqvi@cc.hut.fi>
	
	PR fortran/22390
	* io/backspace.c: File removed, contents moved to ...
	* io/endfile.c: Ditto.
	* io/rewind.c: Ditto.
	* io/file_pos.c: New file, ... here.
	* Makefile.am: Add file_pos.c to list, remove obsolete files.
	* Makefile.in: Regenerated.
	
	2005-08-07  Janne Blomqvist <jblomqvi@cc.hut.fi>
	Steven G. Kargl <kargls@comcast.net>
	
	PR fortran/22390
	* gfortran.dg/flush_1.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.515&r2=1.516
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/dump-parse-tree.c.diff?cvsroot=gcc&r1=1.19&r2=1.20
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/gfortran.h.diff?cvsroot=gcc&r1=1.76&r2=1.77
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/io.c.diff?cvsroot=gcc&r1=1.28&r2=1.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.c.diff?cvsroot=gcc&r1=1.42&r2=1.43
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/match.h.diff?cvsroot=gcc&r1=1.13&r2=1.14
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/parse.c.diff?cvsroot=gcc&r1=1.28&r2=1.29
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/resolve.c.diff?cvsroot=gcc&r1=1.49&r2=1.50
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/st.c.diff?cvsroot=gcc&r1=1.8&r2=1.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-io.c.diff?cvsroot=gcc&r1=1.39&r2=1.40
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-stmt.h.diff?cvsroot=gcc&r1=1.5&r2=1.6
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans.c.diff?cvsroot=gcc&r1=1.26&r2=1.27
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.279&r2=1.280
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/Makefile.am.diff?cvsroot=gcc&r1=1.38&r2=1.39
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/Makefile.in.diff?cvsroot=gcc&r1=1.40&r2=1.41
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/flush_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5889&r2=1.5890

Comment 4 kargl 2005-08-07 23:04:22 UTC
I've committed the patch to mainline.  This is an enhancement,
so it is inappropriate for the 4.0 branch (ie. it doesn't fix
a regression).