Bug 33105

Summary: F2003: Support is_iostat_end & is_iostat_eor intrinsics
Product: gcc Reporter: Tobias Burnus <burnus>
Component: fortranAssignee: Francois-Xavier Coudert <fxcoudert>
Status: RESOLVED FIXED    
Severity: enhancement CC: gcc-bugs
Priority: P3 Keywords: patch
Version: 4.3.0   
Target Milestone: ---   
URL: http://gcc.gnu.org/ml/gcc-patches/2007-08/msg02065.html
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2007-08-20 11:48:00
Bug Depends on:    
Bug Blocks: 20585    
Attachments: Diff for invoke.text (only)

Description Tobias Burnus 2007-08-18 11:51:31 UTC
I don't fully understand why having IOSTAT_END/EOR of the module ISO_Fortran_ENV is not enough, but is_iostat_end and is_iostat_eor intrinsics belong to the Fortran 2003 standard.

Test case:

! { dg-do run }
! Test for the Fortran 2003 intrinsics is_iostat_end & is_iostat_eor
!
program test_f2003
use iso_Fortran_env
implicit none
if(.not.is_iostat_end(IOSTAT_END).or.is_iostat_end(0)) call abort()
if(.not.is_iostat_eor(IOSTAT_EOR).or.is_iostat_end(0)) call abort()
end program test_f2003
Comment 1 Tobias Burnus 2007-08-18 12:56:41 UTC
Created attachment 14072 [details]
Diff for invoke.text (only)
Comment 2 Francois-Xavier Coudert 2007-08-20 11:47:59 UTC
I wasn't even aware of their existence! I'll do it (unless you want to?), thanks for the doc patch.
Comment 3 Tobias Burnus 2007-08-21 15:46:12 UTC
> I wasn't even aware of their existence!

Me neither. I found it in the NAG f95 release notes.

> I'll do it (unless you want to?), thanks for the doc patch.

Go ahead.
Comment 4 Francois-Xavier Coudert 2007-08-29 15:16:20 UTC
Subject: Bug 33105

Author: fxcoudert
Date: Wed Aug 29 15:16:00 2007
New Revision: 127903

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127903
Log:
	PR fortran/33105

	* intrinsic.c (add_functions): Add IS_IOSTAT_END and
	IS_IOSTAT_EOR intrinsics.
	* gfortran.h (gfc_isym_id): Add GFC_ISYM_IS_IOSTAT_END and
	GFC_ISYM_IS_IOSTAT_EOR.
	* trans-intrinsic.c (gfc_conv_has_intvalue): New function.
	(gfc_conv_intrinsic_function): Call gfc_conv_has_intvalue for
	GFC_ISYM_IS_IOSTAT_END and GFC_ISYM_IS_IOSTAT_EOR.
	* intrinsic.texi: Add IS_IOSTAT_END and IS_IOSTAT_EOR.

	* gfortran.dg/is_iostat_end_eor_1.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/is_iostat_end_eor_1.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/gfortran.h
    trunk/gcc/fortran/intrinsic.c
    trunk/gcc/fortran/intrinsic.texi
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 Francois-Xavier Coudert 2007-08-29 15:16:47 UTC
Fixed.