From patchwork Fri Mar 1 20:07:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 224438 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 12BAA2C0308 for ; Sat, 2 Mar 2013 07:08: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=1362773302; 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=ZroKxuHHPe7+bflTWjWk ySh6fgE=; b=HoRX01s6kNY65rlfGKozd0z5Rcllk7QRUfkHu9WrrYyN9q5QwDQ9 g2QYZTo+lF/BFfegwcMoPbiWl32XecO4I1vr3UlqX92ApPLAXlNV/QeQR/unXfnp 8dDaR9XzwGANWttbHWDU+31k9bJFDYCWDJZcsld4qMdBoY1SHS7GSSg= 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=GBuY4zgs47bZwStelquzC70nFj/n2T3mC4KnPAPD5/agdTbb4Ho1v0Ql9R7N9G Mc1hVPCioZKHwKT8FoPKkWivwcoOjZ8gMJUQ9DXPUoVikqzrM+OJu+SafyerFMYt wT7sFy29mUsbGEQ+m/3Hnz75PB+D1xj77Pu7cIS7a5F0s=; Received: (qmail 9754 invoked by alias); 1 Mar 2013 20:08:16 -0000 Received: (qmail 9726 invoked by uid 22791); 1 Mar 2013 20:08:15 -0000 X-SWARE-Spam-Status: No, hits=-6.7 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; Fri, 01 Mar 2013 20:08:00 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r21K80V1026858 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 1 Mar 2013 15:08:00 -0500 Received: from zalov.cz (vpn1-7-207.ams2.redhat.com [10.36.7.207]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r21K7wi9014515 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Mar 2013 15:07:59 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.cz (8.14.5/8.14.5) with ESMTP id r21K7vlD016419; Fri, 1 Mar 2013 21:07:58 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r21K7vaD016418; Fri, 1 Mar 2013 21:07:57 +0100 Date: Fri, 1 Mar 2013 21:07:57 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix memory leaks in ldist_gen (PR middle-end/56461) Message-ID: <20130301200757.GE12913@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! When merging partitions together, we remove them from partitions vector, thus don't free them at all. Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2013-03-01 Jakub Jelinek PR middle-end/56461 * tree-loop-distribution.c (ldist_gen): Call partition_free after each partitions.ordered_remove. Jakub --- gcc/tree-loop-distribution.c.jj 2013-01-28 17:06:51.000000000 +0100 +++ gcc/tree-loop-distribution.c 2013-03-01 13:17:11.851331653 +0100 @@ -1306,6 +1306,7 @@ ldist_gen (struct loop *loop, struct gra if (partition->kind == PKIND_REDUCTION) into->kind = PKIND_REDUCTION; partitions.ordered_remove (i); + partition_free (partition); i--; } else @@ -1342,6 +1343,7 @@ ldist_gen (struct loop *loop, struct gra if (partition->kind == PKIND_REDUCTION) into->kind = PKIND_REDUCTION; partitions.ordered_remove (j); + partition_free (partition); j--; } } @@ -1367,6 +1369,7 @@ ldist_gen (struct loop *loop, struct gra bitmap_ior_into (into->stmts, what->stmts); into->kind = PKIND_REDUCTION; partitions.ordered_remove (i); + partition_free (what); } } }