public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Correctly release ipa-reference summarries
@ 2019-10-10 19:25 Jan Hubicka
  2019-10-11 11:14 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Hubicka @ 2019-10-10 19:25 UTC (permalink / raw)
  To: gcc-patches, mliska

Hi,
this patch fixes code removing summaries in ipa-reference.  As a memory
leak it may make sense to backport this to release branches.

Honza

	* ipa-reference.c (propagate): Fix releasing of IPA summaries.
Index: ipa-reference.c
===================================================================
--- ipa-reference.c	(revision 276707)
+++ ipa-reference.c	(working copy)
@@ -891,15 +889,14 @@ propagate (void)
 
   bitmap_obstack_release (&local_info_obstack);
 
-  if (ipa_ref_var_info_summaries == NULL)
+  if (ipa_ref_var_info_summaries != NULL)
     {
       delete ipa_ref_var_info_summaries;
       ipa_ref_var_info_summaries = NULL;
     }
 
-  ipa_ref_var_info_summaries = NULL;
   if (dump_file)
     splay_tree_delete (reference_vars_to_consider);
   reference_vars_to_consider = NULL;
   return remove_p ? TODO_remove_functions : 0;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Correctly release ipa-reference summarries
  2019-10-10 19:25 Correctly release ipa-reference summarries Jan Hubicka
@ 2019-10-11 11:14 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2019-10-11 11:14 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: GCC Patches, Martin Liška

On Thu, Oct 10, 2019 at 9:21 PM Jan Hubicka <hubicka@ucw.cz> wrote:
>
> Hi,
> this patch fixes code removing summaries in ipa-reference.  As a memory
> leak it may make sense to backport this to release branches.

Please do so.

Richard.

> Honza
>
>         * ipa-reference.c (propagate): Fix releasing of IPA summaries.
> Index: ipa-reference.c
> ===================================================================
> --- ipa-reference.c     (revision 276707)
> +++ ipa-reference.c     (working copy)
> @@ -891,15 +889,14 @@ propagate (void)
>
>    bitmap_obstack_release (&local_info_obstack);
>
> -  if (ipa_ref_var_info_summaries == NULL)
> +  if (ipa_ref_var_info_summaries != NULL)
>      {
>        delete ipa_ref_var_info_summaries;
>        ipa_ref_var_info_summaries = NULL;
>      }
>
> -  ipa_ref_var_info_summaries = NULL;
>    if (dump_file)
>      splay_tree_delete (reference_vars_to_consider);
>    reference_vars_to_consider = NULL;
>    return remove_p ? TODO_remove_functions : 0;
>  }

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-11 11:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 19:25 Correctly release ipa-reference summarries Jan Hubicka
2019-10-11 11:14 ` Richard Biener

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).