Commit bbcdfb93 by Jan Hubicka Committed by Jan Hubicka

re PR ipa/65237 (r221040 caused many regressions)

	PR ipa/65237
	* ipa-icf.c (sem_function::merge): Do not attempt to produce alias
	across COMDAT group boundary.

From-SVN: r221079
parent 412049de
2015-02-28 Jan Hubicka <hubicka@ucw.cz> 2015-02-28 Jan Hubicka <hubicka@ucw.cz>
PR ipa/65237
* ipa-icf.c (sem_function::merge): Do not attempt to produce alias
across COMDAT group boundary.
2015-02-28 Jan Hubicka <hubicka@ucw.cz>
PR ipa/65232 PR ipa/65232
* ipa-icf.c (clear_decl_rtl): New function. * ipa-icf.c (clear_decl_rtl): New function.
(sem_function::merge): Clear RTL before forming alias. (sem_function::merge): Clear RTL before forming alias.
......
...@@ -755,12 +755,17 @@ sem_function::merge (sem_item *alias_item) ...@@ -755,12 +755,17 @@ sem_function::merge (sem_item *alias_item)
it is an external functions where we can not create an alias it is an external functions where we can not create an alias
(ORIGINAL_DISCARDABLE) (ORIGINAL_DISCARDABLE)
3) if target do not support symbol aliases. 3) if target do not support symbol aliases.
4) original and alias lie in different comdat groups.
If we can not produce alias, we will turn ALIAS into WRAPPER of ORIGINAL If we can not produce alias, we will turn ALIAS into WRAPPER of ORIGINAL
and/or redirect all callers from ALIAS to ORIGINAL. */ and/or redirect all callers from ALIAS to ORIGINAL. */
if ((original_address_matters && alias_address_matters) if ((original_address_matters && alias_address_matters)
|| original_discardable || (original_discardable
|| !sem_item::target_supports_symbol_aliases_p ()) && (!DECL_COMDAT_GROUP (alias->decl)
|| (DECL_COMDAT_GROUP (alias->decl)
!= DECL_COMDAT_GROUP (original->decl))))
|| !sem_item::target_supports_symbol_aliases_p ()
|| DECL_COMDAT_GROUP (alias->decl) != DECL_COMDAT_GROUP (original->decl))
{ {
/* First see if we can produce wrapper. */ /* First see if we can produce wrapper. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment