This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran,patch] Add IS_IOSTAT_EOR and IS_IOSTAT_END intrinsics
- From: Tobias Burnus <burnus at net-b dot de>
- To: François-Xavier Coudert <fxcoudert at gmail dot com>
- Cc: "fortran at gcc dot gnu dot org" <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 29 Aug 2007 16:57:05 +0200
- Subject: Re: [gfortran,patch] Add IS_IOSTAT_EOR and IS_IOSTAT_END intrinsics
- References: <19c433eb0708290424t7d1605a6o8735585a871449c6@mail.gmail.com>
:REVIEWMAIL:
François-Xavier Coudert wrote:
> Attached patch adds the IS_IOSTAT_EOR and IS_IOSTAT_END intrinsics.
> Documentation and testcase are Tobias' (thanks!). Bootstrapped and
> regtested on x86_64-linux, OK to commit?
>
+ case GFC_ISYM_IS_IOSTAT_END:
+ gfc_conv_has_intvalue (se, expr, -1);
+ break;
+
+ case GFC_ISYM_IS_IOSTAT_EOR:
+ gfc_conv_has_intvalue (se, expr, -2);
I wonder whether one should add some comment, e.g.
gfc_conv_has_intvalue (se, expr, -2); /* IOSTAT_EOR == -2. */
this makes the numbers a bit less magic; on the other hand, the function
is already called "gfc_conv_has_intvalue" and together with
"GFC_ISYM_IS_IOSTAT_END" it is not really needed.
OK with or without this change. (Assuming that I may review my texi
patch and testcase ;-)
I think these were the last missing Fortran 2003 intrinsics.
(I have to admit, I find them quite useless; what is the advantage of
"if(IS_IOSTAT_END(status))" to "if(IOSTAT_END == status)" - except that
one saves one line ("use iso_fortran_env")? Or vice versa, why is there
a constant if there is an intrinsic function?)
Tobias