From patchwork Wed Feb 27 15:59:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 223647 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]) by ozlabs.org (Postfix) with SMTP id DB8732C008C for ; Thu, 28 Feb 2013 03:24:21 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1362587063; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=MpnLHLsuvdtTnH8tT+Df DZcIPtE=; b=upCHcHSpp04xE6FCUcT2uZ0f4Ldp3N/1r4/mHcxFev3x3aWqHLGj nBh5IOSh2tSKCEoglC51eotH/wdY25IACndXQvHQMNoBCLH/MOAlC4aaMlDIv9wp kU3yX/0oIQ8cXKIyblcDVdWsdYWlp9DLqjclFbYT2i6dQ1PXi8EyUlo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=q/1MMTlMxZO/x5bNomziEhsAQLdzWkqt3OowelE23CTQHwqFKMp0kwsd7J8VvV CbUGa7cgtB328nqgEOTY7tT5SHG5ZCd0rVMNncn7EIljhytPOp1AD/2THpnzIfH7 0/B+Tjz3BvKUhDxciUp45OQDX+qBc0782cxV8zO1jHmUc=; Received: (qmail 31007 invoked by alias); 27 Feb 2013 16:24:10 -0000 Received: (qmail 30978 invoked by uid 22791); 27 Feb 2013 16:24:06 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Feb 2013 16:23:57 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1RGNu1a011446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 27 Feb 2013 11:23:57 -0500 Received: from zalov.cz (vpn1-7-146.ams2.redhat.com [10.36.7.146]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r1RG002G031292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 27 Feb 2013 11:00:01 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.cz (8.14.5/8.14.5) with ESMTP id r1RFxxne004022; Wed, 27 Feb 2013 16:59:59 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r1RFxxNe004021; Wed, 27 Feb 2013 16:59:59 +0100 Date: Wed, 27 Feb 2013 16:59:59 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix ipa-cp memory leaks (PR middle-end/56461) Message-ID: <20130227155959.GK12913@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi! known_aggs is freed/released in another function, but not in decide_whether_version_node, where it leaks memory. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2013-02-27 Jakub Jelinek PR middle-end/56461 * ipa-cp.c (decide_whether_version_node): Call vec_free on known_aggs[i].items and release known_aggs vector. Jakub --- gcc/ipa-cp.c.jj 2013-02-21 22:24:12.000000000 +0100 +++ gcc/ipa-cp.c 2013-02-27 09:25:48.557980184 +0100 @@ -3406,6 +3406,9 @@ decide_whether_version_node (struct cgra info = IPA_NODE_REF (node); info->do_clone_for_all_contexts = false; IPA_NODE_REF (clone)->is_all_contexts_clone = true; + for (i = 0; i < count ; i++) + vec_free (known_aggs[i].items); + known_aggs.release (); ret = true; } else