public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dave at hiauly1 dot hia dot nrc dot ca" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/17578] Missed optimization--failure of gcc.c-torture/execute/ieee/compare-fp-3.c at -O1 and above
Date: Tue, 21 Sep 2004 06:20:00 -0000	[thread overview]
Message-ID: <20040921062055.14104.qmail@sourceware.org> (raw)
In-Reply-To: <20040921015638.17578.danglin@gcc.gnu.org>


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


  parent reply	other threads:[~2004-09-21  6:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-21  1:56 [Bug tree-optimization/17578] New: " danglin at gcc dot gnu dot org
2004-09-21  4:33 ` [Bug tree-optimization/17578] " danglin at gcc dot gnu dot org
2004-09-21  4:35 ` pinskia at gcc dot gnu dot org
2004-09-21  6:20 ` dave at hiauly1 dot hia dot nrc dot ca [this message]
2004-09-23  3:18 ` danglin at gcc dot gnu dot org
2004-12-23  2:11 ` pinskia at gcc dot gnu dot org
2004-12-26 20:49 ` cvs-commit at gcc dot gnu dot org
2004-12-26 21:00 ` danglin at gcc dot gnu dot org
2005-01-07 14:15 ` pinskia at gcc dot gnu dot org
2005-01-15  5:26 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040921062055.14104.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).