From 1a90e99fa2f2423a195301adca060dccc3d0755e Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Fri, 13 Nov 2020 21:15:40 +0100 Subject: [PATCH] Fix modref insertion hook. * ipa-modref.c (modref_summaries::insert, modref_summaries_lto::insert): Remove summary if ipa-modref is disabled. --- gcc/ipa-modref.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index 3f46bebed3c..a9797b26b8d 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -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); -- 2.30.2