From patchwork Tue Jun 2 13:52:45 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: 479500 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 1503B1412E2 for ; Tue, 2 Jun 2015 23:53:00 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=yiVv7CyM; 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:references :in-reply-to:content-type; q=dns; s=default; b=b11CzU2AUqpBWXUq5 eV7t6OwBv7/ni/yRUFr8CXT3BcMXpYmS0VaUyqfutOKkaO4AMUHHEMOTsLz8lYSM xSq0hl2suHenTvCPJhToDrlBNkEHH2rzvQ1ZCyx0ByLfAniG4h5XhigqANWfd1uy gpiPKVGSy3VxhFE4HHM65zan60= 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:references :in-reply-to:content-type; s=default; bh=rV2WVuiYc9142Nbg/kTSXwg +9fs=; b=yiVv7CyM/30jacNDqmJF2aOmm0x6fqSvuFAOo+jbqw46hctxfNGboce 6oWprQv3QpT9kIMpmnpobCvZipyZjbyobmC+aH1/qFW2C+5xfn33m48PbI3jm8z8 glsvsrOa+zJpgbgA/AVCr/sW2hugJX3KkjnhB4KN8QBulVG6xg/w= Received: (qmail 2720 invoked by alias); 2 Jun 2015 13:52:54 -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 2711 invoked by uid 89); 2 Jun 2015 13:52:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY 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, 02 Jun 2015 13:52:48 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B0613AAF2 for ; Tue, 2 Jun 2015 13:52:45 +0000 (UTC) Message-ID: <556DB52D.9080903@suse.cz> Date: Tue, 02 Jun 2015 15:52:45 +0200 From: =?windows-1252?Q?Martin_Li=9Aka?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 01/35] Introduce new type-based pool allocator. References: <83d59ba92a3c4b3ba831ebc2fce325f0416848d0.1432735040.git.mliska@suse.cz> <55660262.8050401@redhat.com> <55670EF0.6060400@suse.cz> <55674D20.3010402@redhat.com> <55686A1A.4090105@suse.cz> In-Reply-To: X-IsSubscribed: yes On 06/02/2015 11:48 AM, Andreas Schwab wrote: > In file included from ../../gcc/stmt.c:78:0: > ../../gcc/alloc-pool.h: In function 'void expand_sjlj_dispatch_table(rtx, vec ree_node*>)': > ../../gcc/alloc-pool.h:303:4: error: 'case_node_pool.pool_allocator:\ > :m_block_size' may be used uninitialized in this function [-Werror=maybe-uninit\ > ialized] > block = XNEWVEC (char, m_block_size); > ^ > ../../gcc/stmt.c:1339:33: note: 'case_node_pool.pool_allocator::m_bl\ > ock_size' was declared here > pool_allocator case_node_pool ("struct sjlj_case pool", > ^ > > Andreas. > Hi. This patch for the issue which has been tested on x86_64-unknown-linux-pc and can bootstrap. Ready for trunk? Thanks, Martin From 57355c1e271accc3e35dd5df9d5393ee783d765b Mon Sep 17 00:00:00 2001 From: mliska Date: Tue, 2 Jun 2015 13:26:05 +0200 Subject: [PATCH] Pool allocator fallout: fix uninialized class members. gcc/ChangeLog: 2015-06-02 Martin Liska * alloc-pool.h (pool_allocator::pool_allocator): Set implicit values to avoid -Wmaybe-uninitialized errors. --- gcc/alloc-pool.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h index 96a1342..ddb2a91 100644 --- a/gcc/alloc-pool.h +++ b/gcc/alloc-pool.h @@ -159,11 +159,11 @@ template inline pool_allocator::pool_allocator (const char *name, size_t num, size_t extra_size, bool ignore_type_size): - m_name (name), m_elts_per_block (num), m_returned_free_list (NULL), + m_name (name), m_id (0), m_elts_per_block (num), m_returned_free_list (NULL), m_virgin_free_list (NULL), m_virgin_elts_remaining (0), m_elts_allocated (0), m_elts_free (0), m_blocks_allocated (0), m_block_list (NULL), - m_ignore_type_size (ignore_type_size), m_extra_size (extra_size), - m_initialized (false) {} + m_block_size (0), m_ignore_type_size (ignore_type_size), + m_extra_size (extra_size), m_initialized (false) {} /* Initialize a pool allocator. */ @@ -215,7 +215,6 @@ pool_allocator::initialize () m_id = last_id; #endif - } /* Free all memory allocated for the given memory pool. */ -- 2.1.4