From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114911 invoked by alias); 18 May 2017 14:26:08 -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 114892 invoked by uid 89); 18 May 2017 14:26:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No 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=guessed, realistic 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; Thu, 18 May 2017 14:26:05 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CB8C7AE00; Thu, 18 May 2017 14:26:06 +0000 (UTC) To: GCC Patches Cc: Jan Hubicka From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] Calculate scaled frequency in HOST_WIDE_INT (PR ipa/80663). Message-ID: <619f46a0-a592-0463-45a3-f95c6a1845be@suse.cz> Date: Thu, 18 May 2017 14:45:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------806BAAB7B0F9ADF087A82F87" X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg01465.txt.bz2 This is a multi-part message in MIME format. --------------806BAAB7B0F9ADF087A82F87 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 189 Hello. Following simple fix removes ubsan in ipa-split.c as mentioned in the PR. Patch can bootstrap on ppc64le-redhat-linux and survives regression tests. Ready to be installed? Martin --------------806BAAB7B0F9ADF087A82F87 Content-Type: text/x-patch; name="0001-Calculate-scaled-frequency-in-HOST_WIDE_INT-PR-ipa-8.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Calculate-scaled-frequency-in-HOST_WIDE_INT-PR-ipa-8.pa"; filename*1="tch" Content-length: 1865 >From f6230b40aa6f9d5a67e6231de2a26bc488dc784d Mon Sep 17 00:00:00 2001 From: marxin Date: Wed, 17 May 2017 13:23:54 +0200 Subject: [PATCH] Calculate scaled frequency in HOST_WIDE_INT (PR ipa/80663). gcc/testsuite/ChangeLog: 2017-05-17 Martin Liska PR ipa/80663 * g++.dg/ipa/pr80663.C: New test. gcc/ChangeLog: 2017-05-17 Martin Liska PR ipa/80663 * ipa-split.c (consider_split): Calculate scaled frequency in HOST_WIDE_INT. --- gcc/ipa-split.c | 7 ++++--- gcc/testsuite/g++.dg/ipa/pr80663.C | 10 ++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/ipa/pr80663.C diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index 80fc31b52f8..9d00849a9fa 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -443,9 +443,10 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, } /* Do not split when we would end up calling function anyway. */ - if (incoming_freq - >= (ENTRY_BLOCK_PTR_FOR_FN (cfun)->frequency - * PARAM_VALUE (PARAM_PARTIAL_INLINING_ENTRY_PROBABILITY) / 100)) + HOST_WIDE_INT scaled_frequency + = ((HOST_WIDE_INT)ENTRY_BLOCK_PTR_FOR_FN (cfun)->frequency + * PARAM_VALUE (PARAM_PARTIAL_INLINING_ENTRY_PROBABILITY) / 100); + if (incoming_freq >= scaled_frequency) { /* When profile is guessed, we can not expect it to give us realistic estimate on likelyness of function taking the diff --git a/gcc/testsuite/g++.dg/ipa/pr80663.C b/gcc/testsuite/g++.dg/ipa/pr80663.C new file mode 100644 index 00000000000..8a5d84bbc05 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr80663.C @@ -0,0 +1,10 @@ +// PR ipa/80663 +// { dg-options "-O2 --param partial-inlining-entry-probability=1234567" } + +struct b +{ +}; +struct d : virtual b +{ +}; +main () { d a; } -- 2.12.2 --------------806BAAB7B0F9ADF087A82F87--