From patchwork Thu Nov 26 08:30:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sujoy Saraswati X-Patchwork-Id: 57319 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp372131lbb; Thu, 26 Nov 2015 00:31:04 -0800 (PST) X-Received: by 10.98.71.194 with SMTP id p63mr38199252pfi.66.1448526664228; Thu, 26 Nov 2015 00:31:04 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id wk6si7222584pac.91.2015.11.26.00.31.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2015 00:31:04 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-415460-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; spf=pass (google.com: domain of gcc-patches-return-415460-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-415460-patch=linaro.org@gcc.gnu.org; dkim=pass header.i=@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=XiJ mTj88MnwUHpwi5fYwg9MPXYm0TpGEAvNGfJ0GrvyZ8EIAyJXRQsUJFaLY3MsLc3P kRN4Fn6aEgLTuBBuPbzdKwx2v6a/dwSm5Gmt7iPII3D0fkuZZzoNWxwOotjg015D O3YN9RoNA3xfIFMR29uxINu9Jg5WT77Py8G7UPHw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:content-type :content-transfer-encoding:mime-version; s=default; bh=FpakrWHUg t7XdJ78wTHHI/L3HUg=; b=N4RDmJuL2VdVqgD1PCc7zDC5KNIRrya08PHna2AkG uKgCGpj/WoFiU/NhHhwtVFieOgEEfgbNHEfnhJW5gsYWDwmNVJO7/WiWNYz7GPv3 E9XYD5CvIFTpXUxQ1ajinruQ17d65JuxUPZPnFkZuQUdqmWLM4bBPN5zMFVsYemy Co= Received: (qmail 86878 invoked by alias); 26 Nov 2015 08:30:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 86865 invoked by uid 89); 26 Nov 2015 08:30:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.7 required=5.0 tests=AWL, BAYES_50, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: g9t5008.houston.hp.com Received: from g9t5008.houston.hp.com (HELO g9t5008.houston.hp.com) (15.240.92.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 26 Nov 2015 08:30:51 +0000 Received: from G4W6310.americas.hpqcorp.net (g4w6310.houston.hp.com [16.210.26.217]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by g9t5008.houston.hp.com (Postfix) with ESMTPS id 0399CCD; Thu, 26 Nov 2015 08:30:49 +0000 (UTC) Received: from G4W6306.americas.hpqcorp.net (16.210.26.231) by G4W6310.americas.hpqcorp.net (16.210.26.217) with Microsoft SMTP Server (TLS) id 14.3.169.1; Thu, 26 Nov 2015 08:30:09 +0000 Received: from G4W3297.americas.hpqcorp.net ([169.254.11.80]) by G4W6306.americas.hpqcorp.net ([16.210.26.231]) with mapi id 14.03.0169.001; Thu, 26 Nov 2015 08:30:09 +0000 From: "Saraswati, Sujoy (OSTL)" To: Joseph Myers , Sujoy Saraswati , GCC Patches CC: Richard Biener Subject: Fix 61441 [2/5] Use REAL_VALUE_ISSIGNALING_NAN instead of REAL_VALUE_ISNAN where appropriate Date: Thu, 26 Nov 2015 08:30:09 +0000 Message-ID: <5379BA8D7E9D7E4D87BF6749A92854C248FC90B6@G4W3297.americas.hpqcorp.net> MIME-Version: 1.0 This patch uses REAL_VALUE_ISSIGNALING_NAN instead of REAL_VALUE_ISNAN to avoid the operation for sNaN. Regards, Sujoy 2015-11-26 Sujoy Saraswati PR tree-optimization/61441 * fold-const.c (const_binop): Use REAL_VALUE_ISSIGNALING_NAN instead of REAL_VALUE_ISNAN to avoid the operation for sNaN. * simplify-rtx.c (simplify_const_binary_operation) Same. Index: gcc/fold-const.c =================================================================== --- gcc/fold-const.c (revision 230851) +++ gcc/fold-const.c (working copy) @@ -1150,9 +1150,10 @@ const_binop (enum tree_code code, tree arg1, tree mode = TYPE_MODE (type); /* Don't perform operation if we honor signaling NaNs and - either operand is a NaN. */ + either operand is a signaling NaN. */ if (HONOR_SNANS (mode) - && (REAL_VALUE_ISNAN (d1) || REAL_VALUE_ISNAN (d2))) + && (REAL_VALUE_ISSIGNALING_NAN (d1) + || REAL_VALUE_ISSIGNALING_NAN (d2))) return NULL_TREE; /* Don't perform operation if it would raise a division Index: gcc/simplify-rtx.c =================================================================== --- gcc/simplify-rtx.c (revision 230851) +++ gcc/simplify-rtx.c (working copy) @@ -3892,7 +3892,8 @@ simplify_const_binary_operation (enum rtx_code cod real_convert (&f1, mode, CONST_DOUBLE_REAL_VALUE (op1)); if (HONOR_SNANS (mode) - && (REAL_VALUE_ISNAN (f0) || REAL_VALUE_ISNAN (f1))) + && (REAL_VALUE_ISSIGNALING_NAN (f0) + || REAL_VALUE_ISSIGNALING_NAN (f1))) return 0; if (code == DIV