This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/19904] Division by zero leads to error
- From: "schnetter at aei dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Feb 2005 17:17:54 -0000
- Subject: [Bug fortran/19904] Division by zero leads to error
- References: <20050211130530.19904.schnetter@aei.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From schnetter at aei dot mpg dot de 2005-02-11 17:17 -------
Actually, gfortran handles nans correctly (according to the IEEE standard) in
all other cases. I can e.g. generate a nan through the expression a/b, if I
only hide from the compiler the fact that b is zero, so that it generates code
that performs the division at run time, and does not try to evaluate it at
compile time.
Also, while your argument is correct that the Fortran 95 standard does not
require nans to be handled correctly, your code is also undefined according to
the Fortran 95 standard, because you use the variable "nan" without defining
it: if you assign to an equivalenced storage an integer value, then you are
only allowed to read out the integer value, and vice versa for the real value.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19904