public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Sujoy Saraswati <ssaraswati@gmail.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	GCC Patches	<gcc-patches@gcc.gnu.org>
Subject: Re: Fix 61441
Date: Fri, 06 Nov 2015 13:09:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.10.1511061301390.10753@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CA+ZXfhVLRjevoBs-JzBh7040CLVAwG0AnWQC_rn3jpP7Y9HsvQ@mail.gmail.com>

On Fri, 6 Nov 2015, Sujoy Saraswati wrote:

> > Shouldn't real_convert do this rather than the caller needing to do it?
> 
> Yes, it should be. I had started by doing this within real_convert but
> then saw that there are quite a few callers where I should add the
> check for flag_signaling_nans. This was making the patch bigger, so
> instead decided to change the caller in this particular case. I will
> try to make the change in real_convert now that we are planning to
> break the patch.

I think the general principle is:

* The caller decides whether folding is desirable (whether it would lose 
exceptions, for example).

* The real.c code is called only when the caller has decided that folding 
is desirable, and should always produce the correct output (which for a 
conversion means producing a quiet NaN from a signaling NaN).

So both places need changes, but real_convert is where the code that makes 
it a quiet NaN should go.

Another place in the patch that looks incorrect: the changes to 
fold-const-call.c calling real_powi and checking if the result is a 
signaling NaN.  The result of real_powi should never be a signaling NaN.  
Rather, real_powi should produce a quiet NaN if its input is a signaling 
NaN, and the callers should check if the argument is a signaling NaN when 
deciding whether to fold, not if the result is.

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2015-11-06 13:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 10:23 Sujoy Saraswati
2015-09-01 12:21 ` Richard Biener
2015-09-02 11:36   ` Sujoy Saraswati
2015-09-02 11:56     ` Richard Biener
2015-09-02 12:16       ` Sujoy Saraswati
2015-09-10  7:33       ` Sujoy Saraswati
2015-09-14 13:50         ` Richard Biener
2015-09-14 20:39           ` Joseph Myers
2015-09-16 13:01             ` Sujoy Saraswati
2015-09-16 17:03               ` Joseph Myers
2015-10-13 10:46                 ` Sujoy Saraswati
2015-10-28 17:19                   ` Joseph Myers
2015-11-05 11:29                     ` Sujoy Saraswati
2015-11-05 16:58                       ` Joseph Myers
2015-11-06  4:56                         ` Sujoy Saraswati
2015-11-06 13:09                           ` Joseph Myers [this message]
2015-11-26  8:28                             ` Saraswati, Sujoy (OSTL)

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=alpine.DEB.2.10.1511061301390.10753@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=ssaraswati@gmail.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).