From patchwork Tue Mar 24 14:02:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 453850 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 BCE551400D5 for ; Wed, 25 Mar 2015 01:02:45 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=u1eBYRSM; dkim-adsp=none (unprotected policy); dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=KvfqTK2+5vNJoJNII/shhzX5RXgzn30MyKpXZYNLyrfM7F UwWmZLWJ3Pn6ngsw2E7BxJrYLKn5AtYxKZNz6YgEQQvTq/wONGgZY/GRuvU2EeUD 0GmI2nMlAJt3MbjqTT6Xn5Juj4blqVQdpfLRe8+h93cvvPVImKNrNMcNp3HGg= 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 :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=OUElW7te9guQ3QOe7LWFTVrThas=; b=u1eBYRSMN11tHLMHInSg vCqUQ0rGY+ti4nvIwx5JLkV9UnJS6l2qXc25oD6uQbv4+VtZFyOrPHm4qHw8TV0m pT3TCcehoeXtVywI8oxUvS//eQrK7TFut+iY4rwKwISmNobU7kHS7bV6giVHSP7t +w6I2TREE71is1n5wSsXuJk= Received: (qmail 104180 invoked by alias); 24 Mar 2015 14:02:38 -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 104170 invoked by uid 89); 24 Mar 2015 14:02:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.2 required=5.0 tests=AWL, BAYES_00, KAM_STOCKTIP autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 24 Mar 2015 14:02:34 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D99E0ACAA for ; Tue, 24 Mar 2015 14:02:30 +0000 (UTC) Message-ID: <55116E76.4070405@suse.cz> Date: Tue, 24 Mar 2015 15:02:30 +0100 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: GCC Patches Subject: [PATCH] Fix PR65538 X-IsSubscribed: yes Hi. In following patch, I've added missing delete call for all item summaries that are allocated within a function_summary container in case the container does not use GGC memory allocation. Can boostrap on ppc64le and no regression is seen on x86_64-linux-pc. Ready for trunk? Thanks, Martin From c9912b88e8a381e6be7dc1e4be4f7b8859d72e2f Mon Sep 17 00:00:00 2001 From: mliska Date: Tue, 24 Mar 2015 13:58:50 +0100 Subject: [PATCH] Fix PR65538. gcc/ChangeLog: 2015-03-24 Martin Liska PR tree-optimization/65538 * symbol-summary.h (function_summary::~function_summary): Relese memory for allocated summaries in case non-GGC template instance. --- gcc/symbol-summary.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/symbol-summary.h b/gcc/symbol-summary.h index 8d7e42c..35615ba 100644 --- a/gcc/symbol-summary.h +++ b/gcc/symbol-summary.h @@ -81,6 +81,12 @@ public: m_symtab_insertion_hook = NULL; m_symtab_removal_hook = NULL; m_symtab_duplication_hook = NULL; + + /* Release all summaries in case we use non-GGC memory. */ + typedef typename hash_map ::iterator map_iterator; + if (!m_ggc) + for (map_iterator it = m_map.begin (); it != m_map.end (); ++it) + delete (*it).second; } /* Traverses all summarys with a function F called with -- 2.1.4