From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110018 invoked by alias); 6 Nov 2015 13:09:24 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 110002 invoked by uid 89); 6 Nov 2015 13:09:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Nov 2015 13:09:21 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Zugla-000145-Dk from joseph_myers@mentor.com ; Fri, 06 Nov 2015 05:09:18 -0800 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Fri, 6 Nov 2015 13:09:17 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1ZuglX-0004H0-As; Fri, 06 Nov 2015 13:09:15 +0000 Date: Fri, 06 Nov 2015 13:09:00 -0000 From: Joseph Myers To: Sujoy Saraswati CC: Richard Biener , GCC Patches Subject: Re: Fix 61441 In-Reply-To: Message-ID: References: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2015-11/txt/msg00621.txt.bz2 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