https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83506
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Though, I guess the real bug is that ipa_free_fn_summary (); is no longer
called for -fno-ipa-pure-const. While the ipa_inline pass had unconditional
gate and so it was freed always if !flag_wpa, ipa-pure-const has a non-trivial
gate and thus it frees only sometimes. Calling ipa_free_fn_summary () in
ipa-inline.c if if (!flag_wpa && !flag_ipa_pure_const && !in_lto_p) is not
nice, as it duplicates the ipa-pure-const.c gate. So, we can do something
like:
--- gcc/ipa.c.jj 2017-09-01 09:26:37.000000000 +0200
+++ gcc/ipa.c 2017-12-20 11:22:57.915226765 +0100
@@ -1270,6 +1270,11 @@ ipa_single_use (void)
varpool_node *var;
hash_map<varpool_node *, cgraph_node *> single_user_map;
+ /* In WPA we use inline summaries for partitioning process. Otherwise,
+ free it if earlier IPA passes have not done so yet. */
+ if (!flag_wpa)
+ ipa_free_fn_summary ();
+
FOR_EACH_DEFINED_VARIABLE (var)
if (!var->all_refs_explicit_p ())
var->aux = BOTTOM;
But I think I have a cleaner patch than that.