Commit de4381a4 by David Malcolm Committed by David Malcolm

ipa-fnsummary.c: fix use-after-free crash (PR jit/82826)

gcc/ChangeLog:
	PR jit/82826
	* ipa-fnsummary.c (ipa_fnsummary_c_finalize): New function.
	* ipa-fnsummary.h (ipa_fnsummary_c_finalize): New decl.
	* toplev.c: Include "ipa-fnsummary.h".
	(toplev::finalize): Call ipa_fnsummary_c_finalize.

From-SVN: r254458
parent 3e2927a1
2017-11-06 David Malcolm <dmalcolm@redhat.com>
PR jit/82826
* ipa-fnsummary.c (ipa_fnsummary_c_finalize): New function.
* ipa-fnsummary.h (ipa_fnsummary_c_finalize): New decl.
* toplev.c: Include "ipa-fnsummary.h".
(toplev::finalize): Call ipa_fnsummary_c_finalize.
2017-11-06 Jakub Jelinek <jakub@redhat.com> 2017-11-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/82838 PR tree-optimization/82838
...@@ -3619,3 +3619,12 @@ make_pass_ipa_fn_summary (gcc::context *ctxt) ...@@ -3619,3 +3619,12 @@ make_pass_ipa_fn_summary (gcc::context *ctxt)
{ {
return new pass_ipa_fn_summary (ctxt); return new pass_ipa_fn_summary (ctxt);
} }
/* Reset all state within ipa-fnsummary.c so that we can rerun the compiler
within the same process. For use by toplev::finalize. */
void
ipa_fnsummary_c_finalize (void)
{
ipa_free_fn_summary ();
}
...@@ -266,4 +266,6 @@ void estimate_node_size_and_time (struct cgraph_node *node, ...@@ -266,4 +266,6 @@ void estimate_node_size_and_time (struct cgraph_node *node,
vec<inline_param_summary> vec<inline_param_summary>
inline_param_summary); inline_param_summary);
void ipa_fnsummary_c_finalize (void);
#endif /* GCC_IPA_FNSUMMARY_H */ #endif /* GCC_IPA_FNSUMMARY_H */
...@@ -83,6 +83,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -83,6 +83,7 @@ along with GCC; see the file COPYING3. If not see
#include "edit-context.h" #include "edit-context.h"
#include "tree-pass.h" #include "tree-pass.h"
#include "dumpfile.h" #include "dumpfile.h"
#include "ipa-fnsummary.h"
#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO) #if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
#include "dbxout.h" #include "dbxout.h"
...@@ -2236,6 +2237,7 @@ toplev::finalize (void) ...@@ -2236,6 +2237,7 @@ toplev::finalize (void)
/* Needs to be called before cgraph_c_finalize since it uses symtab. */ /* Needs to be called before cgraph_c_finalize since it uses symtab. */
ipa_reference_c_finalize (); ipa_reference_c_finalize ();
ipa_fnsummary_c_finalize ();
cgraph_c_finalize (); cgraph_c_finalize ();
cgraphunit_c_finalize (); cgraphunit_c_finalize ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment