This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/21376] libfortran "E" output format causes FPE
- From: "prw at ceiriog1 dot demon dot co dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 May 2005 17:28:44 -0000
- Subject: [Bug libfortran/21376] libfortran "E" output format causes FPE
- References: <20050504072223.21376.prw@ceiriog1.demon.co.uk>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From prw at ceiriog1 dot demon dot co dot uk 2005-05-04 17:28 -------
The problem occurred in a large finite element analysis code I developed.
The toplevel logic was written in C++, and this was linked to a venerable
public domain numerical analysis library in Fortran. My testcase consists
of the following two files. You only get a floating point exception
if IEEE floating point exceptions are enabled. I don't know if it is possible
to do this from a pure Fortran program, but it is certainly possible to
do from C, and I find it important to do this in numerical codes so that
I can see errors where they occur rather than just propagating NaN's through
the program.
File "toplevel.c":
#include <fenv.h>
main()
{
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW );
killer_();
}
File "killer.f":
subroutine killer
write(6,'(x,e10.4)') 1.0
end
gcc -c toplevel.c
gfortran -c killer.f
gcc toplevel.o killer.o -lgfortran
./a.out
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21376