From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1705 invoked by alias); 14 Jan 2019 08:20:07 -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 696 invoked by uid 89); 14 Jan 2019 08:20:07 -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,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=2191, HContent-Transfer-Encoding:8bit X-HELO: one.firstfloor.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (193.170.194.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 14 Jan 2019 08:20:05 +0000 Received: from firstfloor.org (c-71-238-43-142.hsd1.or.comcast.net [71.238.43.142]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by one.firstfloor.org (Postfix) with ESMTPSA id 9B9E38688E; Mon, 14 Jan 2019 09:20:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=firstfloor.org; s=mail; t=1547454000; bh=9Jc8EA42Zui7hsFFfGu2dyaAIQI0NXyKvIVFE703iVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a1eN/9DXex0XBh9EQFXfba6/no+bSZhJAx1r7gmRq7sYcHIzANqtN1QkTOE4hSBu+ 49kZgneR3Cxa5HVfKAAAaRFd3npiDnvHpNcvBZqONbXHIg5nO1PJiCI8TjzmHKm+jU Be/TMSbl6YJCOLPhDq0f9ALxqg2kRGEpu30IZF08= Received: by firstfloor.org (Postfix, from userid 1000) id 9B88CA03EA; Mon, 14 Jan 2019 00:19:56 -0800 (PST) From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: amker.cheng@gmail.com, Andi Kleen Subject: [PATCH 2/3] Fix autoprofiledbootstrap Date: Mon, 14 Jan 2019 08:20:00 -0000 Message-Id: <20190114081942.9088-2-andi@firstfloor.org> In-Reply-To: <20190114081942.9088-1-andi@firstfloor.org> References: <20190114081942.9088-1-andi@firstfloor.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SW-Source: 2019-01/txt/msg00748.txt.bz2 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" 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