Fix ICE in ipa_edge_args_sum_t::duplicate
authorJan Hubicka <jh@suse.cz>
Thu, 1 Oct 2020 13:03:19 +0000 (15:03 +0200)
committerJan Hubicka <jh@suse.cz>
Thu, 1 Oct 2020 13:03:19 +0000 (15:03 +0200)
PR ipa/97244
* ipa-fnsummary.c (pass_free_fnsummary::execute): Free
also indirect inlining datastructure.
* ipa-modref.c (pass_ipa_modref::execute): Do not free them here.
* ipa-prop.c (ipa_free_all_node_params): Do not crash when info does
not exist.
(ipa_unregister_cgraph_hooks): Likewise.

gcc/ipa-fnsummary.c
gcc/ipa-modref.c
gcc/ipa-prop.c

index 4c1c1f91482d0639f8fc8aed1bf22c8e8c76ebe4..8285cc00d33ccad633f49935bc73e7b8ddbb9047 100644 (file)
@@ -4680,6 +4680,8 @@ public:
   virtual unsigned int execute (function *)
     {
       ipa_free_fn_summary ();
+      /* Free ipa-prop structures if they are no longer needed.  */
+      ipa_free_all_structures_after_iinln ();
       if (!flag_wpa)
        ipa_free_size_summary ();
       return 0;
index 6225552e41aecbf5539f3462ee50d126b82b7bf4..2f4da8f2a148e61bd5b8b366ab73661797278f96 100644 (file)
@@ -1681,8 +1681,6 @@ pass_ipa_modref::execute (function *)
     }
   ((modref_summaries *)summaries)->ipa = false;
   ipa_free_postorder_info ();
-  /* Free ipa-prop structures if they are no longer needed.  */
-  ipa_free_all_structures_after_iinln ();
   return 0;
 }
 
index b28c78eeab422764903e7bb685b5840760afce16..ea88fd3fd95e1a7779a8b08d367cd89bc0ab5216 100644 (file)
@@ -4124,7 +4124,8 @@ ipa_free_all_edge_args (void)
 void
 ipa_free_all_node_params (void)
 {
-  ggc_delete (ipa_node_params_sum);
+  if (ipa_node_params_sum)
+    ggc_delete (ipa_node_params_sum);
   ipa_node_params_sum = NULL;
 }
 
@@ -4368,7 +4369,8 @@ ipa_register_cgraph_hooks (void)
 static void
 ipa_unregister_cgraph_hooks (void)
 {
-  symtab->remove_cgraph_insertion_hook (function_insertion_hook_holder);
+  if (function_insertion_hook_holder)
+    symtab->remove_cgraph_insertion_hook (function_insertion_hook_holder);
   function_insertion_hook_holder = NULL;
 }