Bug 33105 - F2003: Support is_iostat_end & is_iostat_eor intrinsics
Summary: F2003: Support is_iostat_end & is_iostat_eor intrinsics
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 enhancement
Target Milestone: ---
Assignee: Francois-Xavier Coudert
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: patch
Depends on:
Blocks: F2003
  Show dependency treegraph
 
Reported: 2007-08-18 11:51 UTC by Tobias Burnus
Modified: 2007-08-29 15:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-08-20 11:48:00


Attachments
Diff for invoke.text (only) (956 bytes, patch)
2007-08-18 12:56 UTC, Tobias Burnus
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.