FP comparisons, C, X86, and NaN's
Gabriel Dos Reis
gdr@cs.tamu.edu
Sun Jun 20 18:49:00 GMT 2004
| > > 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
More information about the Gcc
mailing list