From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12969 invoked by alias); 16 Feb 2006 23:51:39 -0000 Received: (qmail 12959 invoked by uid 22791); 16 Feb 2006 23:51:38 -0000 X-Spam-Check-By: sourceware.org Received: from e31.co.us.ibm.com (HELO e31.co.us.ibm.com) (32.97.110.149) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 16 Feb 2006 23:51:36 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e31.co.us.ibm.com (8.12.11/8.12.11) with ESMTP id k1GNpZKU014104 for ; Thu, 16 Feb 2006 18:51:35 -0500 Received: from d03av01.boulder.ibm.com (d03av01.boulder.ibm.com [9.17.195.167]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VERS6.8) with ESMTP id k1GNnICq218384 for ; Thu, 16 Feb 2006 16:49:18 -0700 Received: from d03av01.boulder.ibm.com (loopback [127.0.0.1]) by d03av01.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id k1GNpYxr016567 for ; Thu, 16 Feb 2006 16:51:34 -0700 Received: from linux-009047018077.beaverton.ibm.com (dyn9047018077.beaverton.ibm.com [9.47.18.77]) by d03av01.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id k1GNpYsJ016547 for ; Thu, 16 Feb 2006 16:51:34 -0700 Received: by linux-009047018077.beaverton.ibm.com (Postfix, from userid 1000) id 1983DEA99; Thu, 16 Feb 2006 15:55:01 -0800 (PST) Subject: [patch] for PR26327 From: Uttam Pawar To: gcc-patches@gcc.gnu.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 16 Feb 2006 23:51:00 -0000 Message-Id: <1140134100.7074.153.camel@dyn9047018077.beaverton.ibm.com> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2006-02/txt/msg01377.txt.bz2 Hello, The following patch fixes the reported memory leaks. I also noticed the fix by Sebastian Pop, for a memory leak in gcc/tree-if-conv.c (ignored from this patch). Bootstrapped on powerpc64-linux. Testing (make check) showed no new regressions. Thanks, Uttam 2006-02-16 Uttam Pawar PR other/26327 * ipa-inline.c (cgraph_early_inlining): Allocate is done after the sorrycount and errorcount check. * loop-unroll.c (referenced_in_one_insn_in_loop_p): Free pointer 'body'. * cfgloop.c (cancel_loop): Free bbs pointer. * collect2.c (prefix_from_string): Free nstore pointer. * reload1.c (fix_abnormal_edges): Free blocks pointer. Index: gcc/ipa-inline.c =================================================================== *** gcc/ipa-inline.c (revision 111144) --- gcc/ipa-inline.c (working copy) *************** cgraph_early_inlining (void) *** 1137,1148 **** { struct cgraph_node *node; int nnodes; ! struct cgraph_node **order = ! XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); int i; if (sorrycount || errorcount) return; #ifdef ENABLE_CHECKING for (node = cgraph_nodes; node; node = node->next) gcc_assert (!node->aux); --- 1137,1150 ---- { struct cgraph_node *node; int nnodes; ! struct cgraph_node **order; int i; if (sorrycount || errorcount) return; + + order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); + #ifdef ENABLE_CHECKING for (node = cgraph_nodes; node; node = node->next) gcc_assert (!node->aux); Index: gcc/loop-unroll.c =================================================================== *** gcc/loop-unroll.c (revision 111144) --- gcc/loop-unroll.c (working copy) *************** referenced_in_one_insn_in_loop_p (struct *** 1532,1537 **** --- 1532,1538 ---- count_ref++; } } + free (body); return (count_ref == 1); } Index: gcc/cfgloop.c =================================================================== *** gcc/cfgloop.c (revision 111144) --- gcc/cfgloop.c (working copy) *************** cancel_loop (struct loops *loops, struct *** 1033,1038 **** --- 1033,1040 ---- /* Free loop data. */ flow_loop_free (loop); + + free (bbs); } /* Cancels LOOP and all its subloops. */ Index: gcc/collect2.c =================================================================== *** gcc/collect2.c (revision 111144) --- gcc/collect2.c (working copy) *************** prefix_from_string (const char *p, struc *** 728,733 **** --- 728,735 ---- else endp++; } + + free (nstore); } ^L /* Main program. */ Index: gcc/reload1.c =================================================================== *** gcc/reload1.c (revision 111144) --- gcc/reload1.c (working copy) *************** fixup_abnormal_edges (void) *** 8342,8347 **** --- 8342,8348 ---- blocks = sbitmap_alloc (last_basic_block); sbitmap_ones (blocks); find_many_sub_basic_blocks (blocks); + sbitmap_free (blocks); } if (inserted)