From b730d1c99180184db28c0711e69fb6c867840630 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sun, 1 Feb 2015 19:46:14 +0100 Subject: [PATCH] re PR ipa/64872 (ICE: Segmentation fault during Chromium PGO build) PR ipa/64872 * ipa-utils.c (ipa_merge_profiles): Add release argument. * ipa-icf.c (sem_function::merge): Do not release body when merging. * ipa-utils.h (ipa_merge_profiles): Update prototype. From-SVN: r220329 --- gcc/ChangeLog | 7 +++++++ gcc/ipa-icf.c | 2 +- gcc/ipa-utils.c | 9 ++++++--- gcc/ipa-utils.h | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ce07fba1b74..548e5dcd26c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-01-29 Jan Hubicka + + PR ipa/64872 + * ipa-utils.c (ipa_merge_profiles): Add release argument. + * ipa-icf.c (sem_function::merge): Do not release body when merging. + * ipa-utils.h (ipa_merge_profiles): Update prototype. + 2015-02-01 Jakub Jelinek PR debug/64817 diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index afb5be5097c..9b2d117b973 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -762,7 +762,7 @@ sem_function::merge (sem_item *alias_item) } alias->icf_merged = true; - ipa_merge_profiles (local_original, alias); + ipa_merge_profiles (local_original, alias, true); alias->create_wrapper (local_original); if (dump_file) diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c index a8bb42d4263..076d71dd0d9 100644 --- a/gcc/ipa-utils.c +++ b/gcc/ipa-utils.c @@ -407,11 +407,13 @@ get_base_var (tree t) /* SRC and DST are going to be merged. Take SRC's profile and merge it into - DST so it is not going to be lost. Destroy SRC's body on the way. */ + DST so it is not going to be lost. Possibly destroy SRC's body on the way + unless PRESERVE_BODY is set. */ void ipa_merge_profiles (struct cgraph_node *dst, - struct cgraph_node *src) + struct cgraph_node *src, + bool preserve_body) { tree oldsrcdecl = src->decl; struct function *srccfun, *dstcfun; @@ -652,7 +654,8 @@ ipa_merge_profiles (struct cgraph_node *dst, e->frequency = freq; } } - src->release_body (); + if (!preserve_body) + src->release_body (); inline_update_overall_summary (dst); } /* TODO: if there is no match, we can scale up. */ diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index b815b742c7a..ea0f8b379f4 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -44,7 +44,7 @@ bool ipa_edge_within_scc (struct cgraph_edge *); int ipa_reverse_postorder (struct cgraph_node **); tree get_base_var (tree); void ipa_merge_profiles (struct cgraph_node *dst, - struct cgraph_node *src); + struct cgraph_node *src, bool preserve_body = false); bool recursive_call_p (tree, tree); /* In ipa-profile.c */ -- 2.30.2