From patchwork Wed Jun 16 15:56:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 55904 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 305461007D2 for ; Thu, 17 Jun 2010 01:57:09 +1000 (EST) Received: (qmail 19022 invoked by alias); 16 Jun 2010 15:57:06 -0000 Received: (qmail 18974 invoked by uid 22791); 16 Jun 2010 15:57:05 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam-dmz.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 Jun 2010 15:57:00 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 7E8789AC8A8; Wed, 16 Jun 2010 17:56:58 +0200 (CEST) Date: Wed, 16 Jun 2010 17:56:58 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Plug memory leak I introduced in df_compact_blocks Message-ID: <20100616155658.GB17142@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) 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, I am testing the following and will commit it as obvious. That reordering loop gave me some hard time since it used to try to handle "orphane" blocks that did not exist. I removed the code in one of last incarnations of the patch that lead me to remove the free too. Honza * df-core.c (df_compact_blocks): Free problem_temps vector. --- df-core.c (revision 160678) +++ df-core.c (working copy) @@ -1489,6 +1547,7 @@ df_compact_blocks (void) + i * dflow->problem->block_info_elt_size, 0, (last_basic_block - i) * dflow->problem->block_info_elt_size); + free (problem_temps); } }