From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25843 invoked by alias); 24 Sep 2018 07:37:01 -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 25358 invoked by uid 89); 24 Sep 2018 07:36:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy=programming X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 24 Sep 2018 07:36:56 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 450E2B0D8 for ; Mon, 24 Sep 2018 07:36:54 +0000 (UTC) Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Date: Mon, 24 Sep 2018 09:36:53 +0200 Resent-Message-ID: <19ab1d1c-7837-a814-102d-213dfbda08c5@suse.cz> Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 Message-Id: <49d125d60e220ad2cc5fa83af0a56e3d1522b8f5.1537774329.git.mliska@suse.cz> In-Reply-To: References: From: marxin Date: Mon, 24 Sep 2018 07:37:00 -0000 Subject: [PATCH 4/4] Fix scaling of a sreal number. To: gcc-patches@gcc.gnu.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.19.0" X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg01316.txt.bz2 This is a multi-part message in MIME format. --------------2.19.0 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Content-length: 977 The patch is addressing following LLVM warning: gcc/ipa-fnsummary.c:2745:54:Value Conversion Issue: implicit conversion from 'double' to 'int64_t' (aka 'long') changes value from 0.99 to 0: -Wliteral-conversion Taking look at GIMPLE IR we end up with: : D.107433 ={v} {CLOBBER}; sreal::sreal (&D.107437, -1, 0); sreal::sreal (&D.107434, 0, 0); D.107435 = sreal::operator* (&time, &D.107434); D.107436 = sreal::operator- (&nonspecialized_time, &D.107435); _65 = operator>= (&D.107436, &D.107437); _66 = ~_65; if (_66 != 0) goto ; [INV] else goto ; [INV] : fancy_abort ("/home/marxin/Programming/gcc/gcc/ipa-fnsummary.c", 2745, &__FUNCTION__); which confirms the warning. gcc/ChangeLog: 2018-09-23 Martin Liska * ipa-fnsummary.c (estimate_node_size_and_time): Scale by two integers and not by a float value. --- gcc/ipa-fnsummary.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --------------2.19.0 Content-Type: text/x-patch; name="0004-Fix-scaling-of-a-sreal-number.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="0004-Fix-scaling-of-a-sreal-number.patch" Content-length: 677 diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 62095c6cf6f..9cb7d41ccc5 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -2742,7 +2742,7 @@ estimate_node_size_and_time (struct cgraph_node *node, gcc_checking_assert (time >= 0); /* nonspecialized_time should be always bigger than specialized time. Roundoff issues however may get into the way. */ - gcc_checking_assert ((nonspecialized_time - time * 0.99) >= -1); + gcc_checking_assert ((nonspecialized_time - time * 99 / 100) >= -1); /* Roundoff issues may make specialized time bigger than nonspecialized time. We do not really want that to happen because some heurstics --------------2.19.0--