This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug!!
- From: Dick Arndt <arndtra at vt dot edu>
- To: bug-gcc at gnu dot org
- Date: Mon, 14 Jan 2002 10:57:21 -0500
- Subject: Bug!!
I am running gcc version 2.96 20000731 with a g77(or f77) command and
have discovered the following logical disaster: (run the following pgm
with g77 -o xxxx xxx.f )
c Program xxxx
a=193.15
b=0.1
c=a+b
if(a+b.ne.c) write(*,100) a,b,c
100 format(3f20.9)
stop
end
The ne if is satisfied and the write proceeds. Apparently, arithmetic
done inside an "if" statement is done to a different precision than that
done outside the "if" statement. If the compile line contains a -O flag
the pgm works O.K. I am moving a few-hundred lines of FORTRAN from UNIX
to LINUX and this is an intolerable inconsistency to deal with. I've
discovered 3 points of impact already but there may, conceivably, be
many more.
Thank you, I really appreciate the efforts you've put into the
development of a very stable platform.
Richard Arndt
arndtra@vt.edu or arndtra@said.phys.vt.edu