This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FP comparisons, C, X86, and NaN's

| > > 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]