This is the mail archive of the gcc-bugs@gcc.gnu.org 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 libfortran/58020] Code for handling IEEE exceptions


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58020

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #16 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Francois-Xavier Coudert from comment #13)
> I may have a bit of time in November and December to look at this. I
> actually had started implementing the IEEE modules in gfortran back in
> 2008-2009, but never got too far (I was unclear, back then, on the exact
> requirements for things like constant foldingâ some interps have made clear
> that our job is actually easier than I thought back then).

One problem is that behaviour changes when a module is loaded. Related:

- Similar issue in C/C++, cf. "#pragma STDC FENV_ACCESS ON" and also
http://gcc.gnu.org/ml/gcc-patches/2013-10/msg01131.html

- Changes required for the new ISO/IEC/IEEE 60559:2011 standard
(http://www.iso.org/iso/catalogue_detail.htm?csnumber=57469):
http://j3-fortran.org/doc/year/13/13-356.txt


>  2. Although you don't plan to support other architectures than i386/x86_64,
> we have to think about it.

I want to mention that there is now some additional support for IEEE in
libgfortran/config. None of those functions is exported, yet - that permits to
tweak their ABI. All work on x86 hardware, glibc, sysv (= Solaris, FreeBSD),
AIX - which should cover most systems.

a) Enable trapping: set_fpu (invalid, denormal, zero, overflow, underflow,
inexact)  [Used by -ffpe-trap=...]

b) get_fpu_except_flags - returns which exception have been raised by the CPU.
[New in 4.9; used to print those with STOP/ERROR STOP; -ffpe-summary=...]

c) set_fpu_rounding_mode/get_fpu_rounding_mode [New in 4.9; used for I/O
rounding on *input*, only works with "atoi"s which honour the rounding mode,
such as very recent GLIBCs.] - Note that Fortran's required rounding mode
"compatible" is not supported ("nearest" comes close but has different results
for a tie).

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