Fix IPA crash in libgccjit
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 21 Jun 2018 13:44:38 +0000 (13:44 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Thu, 21 Jun 2018 13:44:38 +0000 (13:44 +0000)
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
gcc/ipa-cp.c
gcc/ipa-reference.c

index 266ab55206e5f50a455f3f3c3923d35fb7425463..8d6e6480d4adaab7811d9b5d2cef0ca23dfa3c36 100644 (file)
@@ -1,3 +1,10 @@
+2018-06-21  David Malcolm  <dmalcolm@redhat.com>
+
+       * 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  <tdevries@suse.de>
 
        PR tree-optimization/85859
index c192e84f452ce3fb940bc75d44b0fd4eed9c6589..42dd4cc29042300a89ee75e00860d2552484fbbc 100644 (file)
@@ -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");
index 9a9e94c3414637d4c4a8babbde10e5d8b987cc0c..43bbdae5d6638df4404ae4611241d8b4804c3f67 100644 (file)
@@ -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);