From patchwork Thu May 19 10:44:06 2016 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: 623929 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 3r9ST20fjfz9sBc for ; Thu, 19 May 2016 20:47:49 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=MMJ5tFLw; 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 :resent-from:resent-to:resent-date:resent-message-id:message-id :in-reply-to:references:from:date:subject:to; q=dns; s=default; b= ZK3OtpDlNFo1/yaT3NliJ1BGlK5qcI8kBaZkGRyrNIEvqTt7g1cbXZ+yLMLEe4oQ t126CAz8z+iOP0hn74WgIrYitretoNTA/CA3urlkJo9zY5Pe3SL2k7NB7quynoq+ ooS17B1ubyK2DbYVCzscyM6Ie3/2DZBZe9yvEeLTkgM= 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 :resent-from:resent-to:resent-date:resent-message-id:message-id :in-reply-to:references:from:date:subject:to; s=default; bh=yqbD PU22BwqTRx4iM+r8RNN3C5o=; b=MMJ5tFLw7NxeD9BxlXhLO26Vp9YxtoBU9Vm9 yOqP2yk0dI2VCV/IAmwupsbZ3QoC3+LPdMfaxGfSTAanroB8cUdiGq6O5Gn6dnsI 5eFjp3U390icDeh3iY+Ng/odUzHLbB6kR2R+s4aHyrSYwywMpV7kBBjHGXpbGEbj NPr3IkY= Received: (qmail 93091 invoked by alias); 19 May 2016 10:47:06 -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 93025 invoked by uid 89); 19 May 2016 10:47:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=BAYES_00, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=Hx-languages-length:788, HX-detected-operating-system:timestamps, HX-HELO:eggs.gnu.org, Hx-spam-relays-external:208.118.235.92 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 19 May 2016 10:46:58 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b3LTf-0003YE-T0 for gcc-patches@gcc.gnu.org; Thu, 19 May 2016 06:46:56 -0400 Received: from mx2.suse.de ([195.135.220.15]:43284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b3LTf-0003Y3-ML for gcc-patches@gcc.gnu.org; Thu, 19 May 2016 06:46:51 -0400 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B59DAACC7 for ; Thu, 19 May 2016 10:46:49 +0000 (UTC) Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Date: Thu, 19 May 2016 12:46:49 +0200 Resent-Message-ID: <573D9999.1010602@suse.cz> Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 Message-Id: In-Reply-To: References: From: marxin Date: Thu, 19 May 2016 12:44:06 +0200 Subject: [PATCH 3/9] Fix leak in gcc/tree-ssa-reassoc.c. To: gcc-patches@gcc.gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 X-IsSubscribed: yes Leak can be seen e.g. here: gcc reassoc-11.c -fno-diagnostics-show-caret -fdiagnostics-color=never -O2 -fdump-tree-reassoc1 gcc/ChangeLog: 2016-05-18 Martin Liska * tree-ssa-reassoc.c (eliminate_duplicate_pair): Truncate an auto_vec instead of re-creating it. --- gcc/tree-ssa-reassoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 3b5f36b..81b8977 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -732,7 +732,7 @@ eliminate_duplicate_pair (enum tree_code opcode, if (ops->length () == 2) { - ops->create (0); + ops->truncate (0); add_to_ops_vec (ops, build_zero_cst (TREE_TYPE (last->op))); *all_done = true; }