[fortran,patch] Allow some IEEE functions in constant and specification expressions

FX fxcoudert@gmail.com
Thu Aug 6 16:11:00 GMT 2015


The attached patch fixes the only remaining IEEE bug (to my knowledge) in gfortran.

A Fortran 2008 interpretation request was submitted two years ago about which of the IEEE functions were supposed to be used in constant and specification expressions. The interp, voted on by J3 in Nov 2014, made corrections to the standard (see my comment at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64104#c3 for the detail of this). This front-end patch makes gfortran conforming with the standard.

There is a minor caveat: since support for various kinds (results of the IEEE_SELECTED_REAL_KIND, IEEE_SUPPORT_ROUNDING, IEEE_SUPPORT_FLAG and IEEE_SUPPORT_HALTING functions) are detected at runtime, we need in the future a mechanism to communication the support detected in libgfortran back to the front-end. The current approach does not do that, but instead assumes that if IEEE modules are present, support is enabled for all flags and rounding modes. This is true on the common platforms (x86 and x86_64), so I guess it’s good enough to enable it now. In the meantime, I’m thinking about how best to achieve the long-term goal (spec file? secret logical constants in the IEEE modules?) for the future.

Bootstrapped and regtested on x86_64-apple-darwin14. OK to commit to trunk?

FX




-------------- next part --------------
A non-text attachment was scrubbed...
Name: ieee.ChangeLog
Type: application/octet-stream
Size: 690 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150806/95264fab/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ieee.diff
Type: application/octet-stream
Size: 10248 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20150806/95264fab/attachment-0001.obj>


More information about the Gcc-patches mailing list