From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124790 invoked by alias); 14 Jan 2019 09:11:47 -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 122883 invoked by uid 89); 14 Jan 2019 09:11:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sometime, Hx-languages-length:2664 X-HELO: mail-io1-f66.google.com Received: from mail-io1-f66.google.com (HELO mail-io1-f66.google.com) (209.85.166.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Jan 2019 09:11:45 +0000 Received: by mail-io1-f66.google.com with SMTP id v10so17019081ios.13 for ; Mon, 14 Jan 2019 01:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Pw9aI1soHTjXrWatc4hU2DVr5tpBpskYY13b2himVSM=; b=Mbgje0RvZUZrXX/K8gK9yeTE+Rv/iZPD+3OUzG1VKsW4LOyqmesrakFXOinbGBghNu s0Dq8zgV1+B0eHpq2qzRUZRgKoD9pn0UWkL5OY4tKQviizZJxp5eLxSYUXBBObmbgx6h uKTixFGtU4FNJ6mIPrnVKVgcldN7venDHw/6UZIHdkwzruQfkWieyf8RIX1nADKhplW5 PTBrjkiSR4eWEUCETgVTCAR1eDJjkujDhiZV0dGtWlgGDoOd4T8vCFqbLsVt7aXuCWhR c3/jTc7CQNYUugRQSfXj0jxU2Lftqci530ObAYw1lfP0cM0/O5XjJDnHEbeWuPocgAd+ teyw== MIME-Version: 1.0 References: <20190114081942.9088-1-andi@firstfloor.org> <20190114081942.9088-2-andi@firstfloor.org> In-Reply-To: <20190114081942.9088-2-andi@firstfloor.org> From: "Bin.Cheng" Date: Mon, 14 Jan 2019 09:11:00 -0000 Message-ID: Subject: Re: [PATCH 2/3] Fix autoprofiledbootstrap To: Andi Kleen Cc: gcc-patches List , Andi Kleen Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00757.txt.bz2 On Mon, Jan 14, 2019 at 4:20 PM Andi Kleen wrote: > > From: Andi Kleen > > autoprofiledbootstrap fails currently with > > In file included from ../../gcc/gcc/hash-table.h:236, > from ../../gcc/gcc/coretypes.h:440, > from ../../gcc/gcc/ipa-devirt.c:110: > In static member function 'static void va_heap::release(vec*&) [with T = tree_node*]', > inlined from 'void vec::release() [with T = tree_node*]' at ../../gcc/gcc/vec.h:1679:20, > inlined from 'auto_vec::~auto_vec() [with T = tree_node*; long unsigned int N = 8]' at ../../gcc/gcc/vec.h:1436:5, > inlined from 'vec possible_polymorphic_call_targets(tree, long int, ipa_polymorphic_call_context, bool*, void**, bool)' at ../../gcc/gcc/ipa-devirt.c:3099:22: > ../../gcc/gcc/vec.h:311:10: error: attempt to free a non-heap object 'bases_to_consider' [-Werror=free-nonheap-object] > 311 | ::free (v); > | ~~~~~~~^~~ > ../../gcc/gcc/vec.h:311:10: error: attempt to free a non-heap object 'bases_to_consider' [-Werror=free-nonheap-object] > cc1plus: all warnings being treated as errors > > The problem is that auto_vec uses a variable to keep track if the vector > is on the heap or auto. Normally this gets constant resolved, but only > when the right functions are inlined. With autofdo for some reason > the compiler decides to not inline these vec functions, even though > they are marked as "inline" A comment not closely related to this patch. We observed the same inline behavior in which perf data is inadequate, sometime it has non-trivial impact on kernel compilation. We have patch fall back to guessed profile count if the profiled count is of low quality. Will send it out in GCC10. Thanks, bin > > Mark them as ALWAYS_INLINE instead. > > gcc/: > > 2019-01-14 Andi Kleen > > * vec.h (using_auto_storage, release): Mark as ALWAYS_INLINE. > --- > gcc/vec.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gcc/vec.h b/gcc/vec.h > index 407269c5ad3..1f5b78b1fac 100644 > --- a/gcc/vec.h > +++ b/gcc/vec.h > @@ -1664,7 +1664,7 @@ vec::create (unsigned nelems MEM_STAT_DECL) > /* Free the memory occupied by the embedded vector. */ > > template > -inline void > +ALWAYS_INLINE void > vec::release (void) > { > if (!m_vec) > @@ -1940,7 +1940,7 @@ vec::reverse (void) > } > > template > -inline bool > +ALWAYS_INLINE bool > vec::using_auto_storage () const > { > return m_vec->m_vecpfx.m_using_auto_storage; > -- > 2.19.1 >