This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/18026] boz initialization of REALs fails
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Oct 2006 16:47:15 -0000
- Subject: [Bug fortran/18026] boz initialization of REALs fails
- References: <bug-18026-6318@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from kargl at gcc dot gnu dot org 2006-10-02 16:47 -------
Remove reject-valid keyword, again!
Return this to enhancement.
This is NOT a bug. g77 compatibility and the Fortran 95 standard
have a conflict, and so IMNSHO the Fortran 95 standard wins.
See comment #3. The Fortran 95 standard has quite explicit language
concerning how a BOZ is handled in a DATA statement, and that is what
gfortran implements. A BOZ is handled consistently so that the
gfortran extension of allowing a BOZ in an assignment gives the same
result as the DATA statement.
troutmask:kargl[204] cat a.f90
PROGRAM GFCBUG19
DOUBLE PRECISION y, x
DATA x / Z'7FF0000000000000' / ! Conforms to Fortran 95 standard
y = Z'7FF0000000000000' ! gfortran extension
print *, x, y
END
troutmask:kargl[205] gfc -o z a.f90
troutmask:kargl[206] ./z
9.218868437227405E+018 9.218868437227405E+018
If someone wants to create a patch to implement a -fbroken-boz-behavior
option, then that's fine. OTOH, the user can use the bit manipulation
functions and TRANSFER to create whatever bit pattern the user wants.
Or, the user can use the -fno-range-check option and simply compute
inf = 1./0. and nan = 0. / .0.
--
kargl at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu dot org
Severity|normal |enhancement
Keywords|rejects-valid |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18026