This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix DF mw_hardregs memory leaks (PR middle-end/56461)


looks ok, not my call as to the as to the appropriate for stage 4.
On 02/27/2013 11:01 AM, Jakub Jelinek wrote:
Hi!

We can leak mw_hardregs memory in some cases.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux,
ok for trunk?

2013-02-27 Jakub Jelinek <jakub@redhat.com>

	PR middle-end/56461
	* df-scan.c (df_insn_delete): Use df_scan_free_mws_vec before
	pool_free.
	(df_insn_rescan_debug_internal): Use df_scan_free_mws_vec before
	overwriting it.

--- gcc/df-scan.c.jj 2013-01-11 09:02:45.000000000 +0100
+++ gcc/df-scan.c 2013-02-27 10:01:13.052826959 +0100
@@ -1153,6 +1153,7 @@ df_insn_delete (basic_block bb, unsigned
df_ref_chain_delete (insn_info->defs);
df_ref_chain_delete (insn_info->uses);
df_ref_chain_delete (insn_info->eq_uses);
+ df_scan_free_mws_vec (insn_info->mw_hardregs);
}
pool_free (problem_data->insn_pool, insn_info);
DF_INSN_UID_SET (uid, NULL);
@@ -1332,6 +1333,7 @@ df_insn_rescan_debug_internal (rtx insn)
df_ref_chain_delete (insn_info->defs);
df_ref_chain_delete (insn_info->uses);
df_ref_chain_delete (insn_info->eq_uses);
+ df_scan_free_mws_vec (insn_info->mw_hardregs);
insn_info->defs = df_null_ref_rec;
insn_info->uses = df_null_ref_rec;


Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]