Fix modref insertion hook.
authorJan Hubicka <jh@suse.cz>
Fri, 13 Nov 2020 20:15:40 +0000 (21:15 +0100)
committerJan Hubicka <jh@suse.cz>
Fri, 13 Nov 2020 20:15:40 +0000 (21:15 +0100)
* ipa-modref.c (modref_summaries::insert,
modref_summaries_lto::insert): Remove summary if ipa-modref is disabled.

gcc/ipa-modref.c

index 3f46bebed3ccf510842f2612ea4b595f6be493b1..a9797b26b8da2b48012fc06e254746829b2679df 100644 (file)
@@ -1273,7 +1273,8 @@ modref_summaries::insert (struct cgraph_node *node, modref_summary *)
       optimization_summaries->remove (node);
       return;
     }
-  if (!DECL_STRUCT_FUNCTION (node->decl))
+  if (!DECL_STRUCT_FUNCTION (node->decl)
+      || !opt_for_fn (node->decl, flag_ipa_modref))
     {
       summaries->remove (node);
       return;
@@ -1292,6 +1293,7 @@ modref_summaries_lto::insert (struct cgraph_node *node, modref_summary_lto *)
      propagated.  This is done only by SIMD cloning that is not very
      critical.  */
   if (!DECL_STRUCT_FUNCTION (node->decl)
+      || !opt_for_fn (node->decl, flag_ipa_modref)
       || propagated)
     {
       summaries_lto->remove (node);