This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ipa/83506] [8 Regression] ICE: Segmentation fault in force_nonfallthru_and_redirect
- From: "prathamesh3492 at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 20 Dec 2017 10:46:33 +0000
- Subject: [Bug ipa/83506] [8 Regression] ICE: Segmentation fault in force_nonfallthru_and_redirect
- Auto-submitted: auto-generated
- References: <bug-83506-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83506
--- Comment #5 from prathamesh3492 at gcc dot gnu.org ---
(In reply to Jakub Jelinek from comment #4)
> 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.
Hi Jakub,
Thanks for the fix! In r254140, I removed the call to ipa_free_fn_summary()
gated on !flag_wpa from inline pass since ipa-pure-const required it for
propagating malloc attribute, which unfortunately caused the above bug.
Regards,
Prathamesh