This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is comparing against 0.0 safe?
- To: lucier at math dot purdue dot edu (Brad Lucier)
- Subject: Re: Is comparing against 0.0 safe?
- From: Brad Lucier <lucier at math dot purdue dot edu>
- Date: Tue, 15 Feb 2000 20:38:12 -0500 (EST)
- Cc: ghazi at caip dot rutgers dot edu, lucier at math dot purdue dot edu (Brad Lucier), gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, geoffk at cygnus dot com
Re:
> In fact, does anyone mind if I add this extra documentation?
Yes. It's naive numerical analysis that I can't imagine will help anyone
write a floating-point program of moderate size or sophistication.
(That was with my "Numerical Analysis Professor" hat on.)
Also, as a programmer, I generally feel more comfortable with the correctness
of my code if gcc compiles the code without complaint, even with more warnings
enabled. Again, in my opinion, having floating-point code compile without
triggering *this* warning does not give me any added sense of safety.
In other words, as long as I'm working with gcc on an *86 machine with
1. (more or less random) 64-bit register spills instead of 80-bit spills, and
2. -ffloat-store not being sophisticated enough to ensure reproducibility
of values that one gets on machines without extra-precision registers
(so I can't write code that either consistently takes advantage of the
extra precision, or generates the same results as on machines without
the extra precision), then I don't think that gcc is a sophisticated enough
tool to warrant a warning that gives a false sense of well-being to naive
(and I mean naive, if this warning is going to help) floating-point programmers
whose code passes it.
So let's just leave it for people who see it and say "Hey, that's exactly
what I need" rather than trying to explain to them why they should need it.
(In which case, I'd probably like to try to explain to them why they
don't need it ;-)
Brad Lucier