From patchwork Mon Jan 14 08:19:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 1024319 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-493979-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=firstfloor.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="x3R7clJx"; dkim=pass (1024-bit key; unprotected) header.d=firstfloor.org header.i=@firstfloor.org header.b="a1eN/9DX"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43dRH34g59z9s7T for ; Mon, 14 Jan 2019 19:20:14 +1100 (AEDT) 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:in-reply-to:references :mime-version:content-transfer-encoding; q=dns; s=default; b=rr0 Sf0UKchjAnQ5ul5ifb1jecFXRyR1VpYxYHAKCBoswP1pgqXFVDtgl0jl+R5kFHuJ /kQzXTu+2mzi41KHRsUMXUMzO/ll3V9KmHw81TqOG/rMlWFbvEF01wLgO8ozu0sl 1tVQF3DxyMN9y2XsVHy3zEMxLkkba9BdJp41sngg= 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:in-reply-to:references :mime-version:content-transfer-encoding; s=default; bh=4AS1qCYUB NUSDPKEf9sbAj+GiyI=; b=x3R7clJx4XEYPljFF6s8aOLE1OKixAoK38r6pYCFE Vm6fz9SStS1bRZHZgOMdJc79ezroQrtM6oKQp+/sKfG8b3oQdJQCsLCwbuDEPLBe C6U7hA5MHibSTNf8kpFBaKlchmmwD5RAUspGZTs3/c4p7IX3zJRpHym3AE7Os0Gd aM= 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-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 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 00:19:41 -0800 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 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;