From: Uttam Pawar <uttamp@us.ibm.com>
To: gcc-patches@gcc.gnu.org
Subject: [patch] for PR26327
Date: Thu, 16 Feb 2006 23:51:00 -0000 [thread overview]
Message-ID: <1140134100.7074.153.camel@dyn9047018077.beaverton.ibm.com> (raw)
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 <uttamp@us.ibm.com>
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)
next reply other threads:[~2006-02-16 23:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-16 23:51 Uttam Pawar [this message]
2006-02-21 19:36 ` patch Ping Uttam Pawar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1140134100.7074.153.camel@dyn9047018077.beaverton.ibm.com \
--to=uttamp@us.ibm.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).