From 412049de810dde0c4d97742678e6a36ca477aeda Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 28 Feb 2015 23:46:22 +0100 Subject: [PATCH] re PR bootstrap/65232 (bootstrap failure (ICE in change_symbol_block, at varasm.c:1230) on arm-linux-gnueabihf, in libstdc++ stage1) PR ipa/65232 * ipa-icf.c (clear_decl_rtl): New function. (sem_function::merge): Clear RTL before forming alias. (sem_variable::merge): Clear RTL before forming alias. From-SVN: r221078 --- gcc/ChangeLog | 7 +++++++ gcc/ipa-icf.c | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c8c9a58b74..db44c2894f5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-02-28 Jan Hubicka + + PR ipa/65232 + * ipa-icf.c (clear_decl_rtl): New function. + (sem_function::merge): Clear RTL before forming alias. + (sem_variable::merge): Clear RTL before forming alias. + 2015-02-28 Jan Hubicka PR ipa/65236 diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 5d50b6f639b..ef7c855c8e1 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -632,7 +632,7 @@ set_local (cgraph_node *node, void *data) return false; } -/* TREE_ADDRESSABLE of NODE to true if DATA is non-NULL. +/* TREE_ADDRESSABLE of NODE to true. Helper for call_for_symbol_thunks_and_aliases. */ static bool @@ -642,6 +642,16 @@ set_addressable (varpool_node *node, void *) return false; } +/* Clear DECL_RTL of NODE. + Helper for call_for_symbol_thunks_and_aliases. */ + +static bool +clear_decl_rtl (symtab_node *node, void *) +{ + SET_DECL_RTL (node->decl, NULL); + return false; +} + /* Redirect all callers of N and its aliases to TO. Remove aliases if possible. Return number of redirections made. */ @@ -893,6 +903,9 @@ sem_function::merge (sem_item *alias_item) ipa_merge_profiles (original, alias); alias->release_body (true); alias->reset (); + /* Notice global symbol possibly produced RTL. */ + ((symtab_node *)alias)->call_for_symbol_and_aliases (clear_decl_rtl, + NULL, true); /* Create the alias. */ cgraph_node::create_alias (alias_func->decl, decl); @@ -1512,6 +1525,8 @@ sem_variable::merge (sem_item *alias_item) alias->analyzed = false; DECL_INITIAL (alias->decl) = NULL; + ((symtab_node *)alias)->call_for_symbol_and_aliases (clear_decl_rtl, + NULL, true); alias->need_bounds_init = false; alias->remove_all_references (); if (TREE_ADDRESSABLE (alias->decl)) -- 2.30.2