This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
FP comparisons, C, X86, and NaN's
- From: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- To: gcc at gcc dot gnu dot org
- Cc: Chris Lattner <sabre at nondot dot org>
- Date: 18 Jun 2004 09:32:19 -0500
- Subject: FP comparisons, C, X86, and NaN's
- Organization: Texas A&M University, Department of Computer Science
| > > 2. C does not define whether or not standard relational operations trap.
| > > If this is the case, there is no bug in GCC.
| So you are saying that this is the case: it is undefined whether an
| implementation traps on a comparison with nans? This is my interpretation
| of this passage:
No! That section explicitly says that isxxx type generic macros
are _quiet_ in the sense that they *do not raise* floating-point
exception or traps or whatever. It is not implementation defined. It
is prescribed. Please consider the whole section I quoted.
| > -- is true. Relational operators may raise the
| > ``invalid'' floating-point exception when argument values
| > are NaNs.
|
| I just want to make sure that I'm intepreting things correctly.
"Relation operators" in the above quote means the usual <, >, <=, >=,
==, !=. Not the isgreater, isxxxx... type generic macros.
Said differently, you've discovered a bug in the code GCC generates.
-- Gaby