public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: gcc@gcc.gnu.org, gdr@integrable-solutions.net, rth@redhat.com
Subject: One more limits question
Date: Wed, 29 Jan 2003 22:05:00 -0000	[thread overview]
Message-ID: <200301292039.h0TKdmL27788@localhost.localdomain> (raw)


I'll try not to open such a huge can of worms this time. :-)

I'm trying to figure out how this code works.

      static const bool has_quiet_NaN
	= __builtin_nanf ("") != __builtin_nanf ("");

The constant-folding machinery seems to always consider this
expression to evaluate to true, due to this code in fold:

	  /* If either operand is a NaN, the result is false with two
	     exceptions: First, an NE_EXPR is true on NaNs, but that case
	     is already handled correctly since we will be inverting the
	     result for NE_EXPR.  Second, if we had inverted a LE_EXPR
	     or a GE_EXPR into a LT_EXPR, we must return true so that it
	     will be inverted into false.  */

	  if (REAL_VALUE_ISNAN (TREE_REAL_CST (arg0))
	      || REAL_VALUE_ISNAN (TREE_REAL_CST (arg1)))
	    t1 = build_int_2 (invert && code == LT_EXPR, 0);

So I'm trying to figure out why this isn't just:

  // We don't yet have a way of computing this correctly.
  static const bool has_quiet_NaN = true;

I'm sure I'm being dense; lay it on me.

Thanks,

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

             reply	other threads:[~2003-01-29 20:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-29 22:05 Mark Mitchell [this message]
2003-01-29 22:10 ` Richard Henderson
2003-01-29 22:13   ` Mark Mitchell
2003-01-29 22:16     ` Richard Henderson
2003-01-29 22:29       ` Mark Mitchell
2003-01-30  0:54         ` Richard Henderson

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=200301292039.h0TKdmL27788@localhost.localdomain \
    --to=mark@codesourcery.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdr@integrable-solutions.net \
    --cc=rth@redhat.com \
    /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).