This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/18026] boz initialization of REALs fails

------- 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
      DATA x / Z'7FF0000000000000' /   ! Conforms to Fortran 95 standard
      y = Z'7FF0000000000000'          ! gfortran extension
      print *, x, y
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               |

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]