From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1AB2B3987C1A; Wed, 30 Sep 2020 15:43:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AB2B3987C1A From: "hubicka at ucw dot cz" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/97235] [11 Regression] ICE in duplicate, at ipa-prop.c:4251 since r11-3478-gada353b87909fd6c Date: Wed, 30 Sep 2020 15:43:39 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at ucw dot cz X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: hubicka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 15:43:40 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97235 --- Comment #2 from Jan Hubicka --- I am testing this fix. Problem is that when modref is disabled we never relase ipa-prop datastructures. 2020-09-30 Jan Hubicka * ipa-fnsummary.c: (pass_free_fnsummary:execute): Call=20=20 ipa_free_all_structures_after_iinln. * ipa-modref.c (pass_ipa_modref::execute): Do not call ipa_free_all_structures_after_iinln. * ipa-prop.c (ipa_free_all_node_params): Do not crash if info is not allocated. (ipa_unregister_cgraph_hooks): Likewise. diff --git a/gcc/ipa-fnsummary.c b/gcc/ipa-fnsummary.c index 4c1c1f91482..8285cc00d33 100644 --- a/gcc/ipa-fnsummary.c +++ b/gcc/ipa-fnsummary.c @@ -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; diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index 6225552e41a..2f4da8f2a14 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -1681,8 +1681,6 @@ pass_ipa_modref::execute (function *) } ((modref_summaries *)summaries)->ipa =3D false; ipa_free_postorder_info (); - /* Free ipa-prop structures if they are no longer needed. */ - ipa_free_all_structures_after_iinln (); return 0; } diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index b28c78eeab4..ea88fd3fd95 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -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 =3D 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 =3D NULL; }=