This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Memory leak patch-I
The patch against bt-load.c is also reported as PR 25739, even if the
proposed patch from Richard Guenther (rguenther@suse.de) is a little
different.
So if your patch is applied, PR 25739 should also be closed.
CJ
"Uttam Pawar" <uttamp@us.ibm.com> a écrit dans le message de
1140223686.7074.161.camel@dyn9047018077.beaverton.ibm.com">news:1140223686.7074.161.camel@dyn9047018077.beaverton.ibm.com...
> Hi,
>
> The following patch fixes some more memory leaks. I did not file any PRs
> to track these leaks (so these are not reported). Let me know if I need
> to open one.
>
> Bootstrapped and regtested on powerpc64-linux. No new regressions.
>
> Thanks,
>
> Uttam
>
>
> Patch
> ======================================================================
>
> 2006-02-17 Uttam Pawar <uttamp@us.ibm.com>
>
> * gensupport.c (identify_predicable_attribute): Free
> p_false pointer.
> * gcov.c (create_file_names): Free name pointer.
> * bt-load.c (augment_live_range): Free tos pointer.
>
> Index: gcc/gensupport.c
> ===================================================================
> *** gcc/gensupport.c (revision 111144)
> --- gcc/gensupport.c (working copy)
> *************** identify_predicable_attribute (void)
> *** 464,469 ****
> --- 464,471 ----
> message_with_line (elem->lineno,
> "attribute `predicable' is not a boolean");
> errors = 1;
> + if (p_false)
> + free (p_false);
> return;
> }
> p_true[-1] = '\0';
> *************** identify_predicable_attribute (void)
> *** 481,492 ****
> --- 483,498 ----
> message_with_line (elem->lineno,
> "attribute `predicable' cannot be const");
> errors = 1;
> + if (p_false)
> + free (p_false);
> return;
>
> default:
> message_with_line (elem->lineno,
> "attribute `predicable' must have a constant
default");
> errors = 1;
> + if (p_false)
> + free (p_false);
> return;
> }
>
> *************** identify_predicable_attribute (void)
> *** 501,506 ****
> --- 507,515 ----
> value);
> errors = 1;
> }
> +
> + if (p_false)
> + free (p_false);
> }
>
> /* Return the number of alternatives in constraint S. */
> Index: gcc/gcov.c
> ===================================================================
> *** gcc/gcov.c (revision 111144)
> --- gcc/gcov.c (working copy)
> *************** create_file_names (const char *file_name
> *** 658,663 ****
> --- 658,664 ----
> strcpy (da_file_name, name);
> strcpy (da_file_name + length, GCOV_DATA_SUFFIX);
>
> + free (name);
> return;
> }
>
> Index: gcc/bt-load.c
> ===================================================================
> *** gcc/bt-load.c (revision 111144)
> --- gcc/bt-load.c (working copy)
> *************** augment_live_range (bitmap live_range, H
> *** 911,916 ****
> --- 911,917 ----
> {
> if (full_range)
> IOR_HARD_REG_SET (*btrs_live_in_range,
btrs_live[new_bb->index]);
> + free (tos);
> return;
> }
> *tos++ = new_bb;
>
>