From e67343d7445768ef22523894ec589791f526234c Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 21 Jun 2018 13:44:38 +0000 Subject: [PATCH] Fix IPA crash in libgccjit gcc/ChangeLog: * ipa-cp.c (ipcp_driver): Set edge_clone_summaries to NULL after deleting it. * ipa-reference.c (ipa_reference_c_finalize): Delete ipa_ref_opt_sum_summaries and set it to NULL. From-SVN: r261846 --- gcc/ChangeLog | 7 +++++++ gcc/ipa-cp.c | 1 + gcc/ipa-reference.c | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 266ab55206e..8d6e6480d4a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-06-21 David Malcolm + + * ipa-cp.c (ipcp_driver): Set edge_clone_summaries to NULL after + deleting it. + * ipa-reference.c (ipa_reference_c_finalize): Delete + ipa_ref_opt_sum_summaries and set it to NULL. + 2018-06-21 Tom de Vries PR tree-optimization/85859 diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index c192e84f452..42dd4cc2904 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -5089,6 +5089,7 @@ ipcp_driver (void) /* Free all IPCP structures. */ free_toporder_info (&topo); delete edge_clone_summaries; + edge_clone_summaries = NULL; ipa_free_all_structures_after_ipa_cp (); if (dump_file) fprintf (dump_file, "\nIPA constant propagation end\n"); diff --git a/gcc/ipa-reference.c b/gcc/ipa-reference.c index 9a9e94c3414..43bbdae5d66 100644 --- a/gcc/ipa-reference.c +++ b/gcc/ipa-reference.c @@ -1230,6 +1230,12 @@ make_pass_ipa_reference (gcc::context *ctxt) void ipa_reference_c_finalize (void) { + if (ipa_ref_opt_sum_summaries != NULL) + { + delete ipa_ref_opt_sum_summaries; + ipa_ref_opt_sum_summaries = NULL; + } + if (ipa_init_p) { bitmap_obstack_release (&optimization_summary_obstack); -- 2.30.2