This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/19116] New: -fno-finite-math-only does not override -ffast-math
- From: "Thomas dot Koenig at online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Dec 2004 20:36:42 -0000
- Subject: [Bug driver/19116] New: -fno-finite-math-only does not override -ffast-math
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat nan-find.f90
program main
real :: a,b,c
logical :: l
b = 0.
c = 0.
a = b/c
call nanfind(a,a,l)
if (l) then
print *,a,"compares equal to itself"
else
print *,a,"compares unequal to itself"
end if
end program main
subroutine nanfind(a,b,l)
real,intent(in) :: a,b
logical, intent(out) :: l
l = a == b
end subroutine nanfind
$ gfortran -O3 -ffast-math -fno-finite-math-only nan-find.f90
$ ./a.out
NaN compares equal to itself
$ gfortran -v
Using built-in specs.
Configured with: ../gcc/configure --prefix=/home/ig25
--enable-languages=c,c++,f95 : (reconfigured) ../gcc/configure
--prefix=/home/ig25 --enable-languages=c,c++,f95
Thread model: posix
gcc version 4.0.0 20041221 (experimental)
$
Then again, I never liked the fact that NaNs can compare
equal with any compiler option...
--
Summary: -fno-finite-math-only does not override -ffast-math
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: driver
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: Thomas dot Koenig at online dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19116