User account creation filtered due to spam.

Bug 22390 - Implement FLUSH statement
Summary: Implement FLUSH statement
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 enhancement
Target Milestone: 4.1.0
Assignee: 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:
Target: 4.1.0
Known to work:
Known to fail:
Last reconfirmed: 2005-07-09 19:42:03


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
Comment 2 Janne Blomqvist 2005-07-11 05:55:36 UTC
Proposed patch here:
Comment 3 CVS Commits 2005-08-07 22:56:26 UTC
Subject: Bug 22390

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	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 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: flush_1.f90 

Log message:
	2005-08-07   Janne Blomqvist <>
	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  <>
	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.
	* Add file_pos.c to list, remove obsolete files.
	* Regenerated.
	2005-08-07  Janne Blomqvist <>
	Steven G. Kargl <>
	PR fortran/22390
	* gfortran.dg/flush_1.f90: New test.


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).