This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

[Bug tree-optimization/17578] Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above


------- Additional Comments From dave at hiauly1 dot hia dot nrc dot ca  2004-09-21 06:20 -------
Subject: Re:  Missed optimization--failure of gcc

> ------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-21
> 04:35 -------
> Actually by the C standard, compares do not trap at all.

C99 indicates that relational operations may raise the invalid exception
when argument values are NaNs.  This includes both quiet and signalling NaNs.
5.2.4.2.2 paragraph 3 states that a signalling NaN generally raises an
exception when used as an arithmetic operand.  As far as I can tell, there
is no exception in this regard for the equality operators.  They are
analogous to the relational operators except for being lower in precedence.

Treating relational operators and equality operators differently with
respect to signalling NaNs would present a significant problem on the
PA-RISC architecture as all floating point comparisons behave in the
same manner.

>From the C standard, it's somewhat ambiguous whether a quiet NaN
should raise an exception in an equality operation.  We currently
don't raise an exception on the PA.

The C standard allows for various floating point models but I don't
think it was intended to be incompatible with IEC 60559:1989.  There
are various "is" macros which don't raise the invalid exception.

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17578


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