This is the mail archive of the
mailing list for the GCC project.
[Bug fortran/18026] boz initialization of REALs fails
- From: "sgk at troutmask dot apl dot washington dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Oct 2006 19:39:33 -0000
- Subject: [Bug fortran/18026] boz initialization of REALs fails
- References: <email@example.com/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from sgk at troutmask dot apl dot washington dot edu 2006-10-23 19:39 -------
Subject: Re: boz initialization of REALs fails
On Mon, Oct 23, 2006 at 06:52:06PM -0000, tobias dot burnus at physik dot
fu-berlin dot de wrote:
> In the Intel Fortran Compiler
> real :: r
> data r/some BOZ/
> gives the same result as using the Fortran 2003 statement in ifort:
> real :: r
> r = real(some boz)
> (At least with the "-switch fe_new_BOZ_constants".)
(1) I'd need to see an example.
(2) The 2 code examples are technically invalid F95.
(3) The first code example is invalid in F2003.
> Therefore, with Fortran 2003 BOZ support in place, implementing this in
> gfortran should then become easier. (Working around will also become easier.(
gfortran implements the F2003 intrepetation of a BOZ in a data
statement. See the BIG comment in match_boz_constant. What is
missing is gfortran does not retain knowledge that a BOZ was seen,
so when you hit
data r/some BOZ/
the "assignment" to r does not know the value can from a BOZ. Hence,
a warning/error can't be issued.
> (As gfortran accepts [integer] BOZ everywhere, it will also have the problem
> whether real( z'F' ) is meant as "convert integer BOZ to integer and then to
> real" or as "convert real BOZ to real". Ifort gives a default warning for both
> -stand f95 and -stand f03, treating the BOZ differently for those two cases.)
I spent a few hours on Friday night and Saturday looking at the F2003
behavior for REAL(z'f'). My first attempt to handle this failed, which
I don't understand. I have a plan B.