From: Jan Hubicka Date: Thu, 19 Mar 2015 17:37:15 +0000 (+0100) Subject: re PR lto/65380 ([ICF] LTO: ICE in add_symbol_to_partition_1, at lto/lto-partition... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=257291fc895a29a88d3d68719e580edcddd9a280;p=gcc.git re PR lto/65380 ([ICF] LTO: ICE in add_symbol_to_partition_1, at lto/lto-partition.c:158) Fix PR ipa/65380. PR ipa/65380 * ipa-icf.c (sem_function::merge): Do not merge DECL_EXTERNAL symbols. (sem_variable::merge): Likewise. From-SVN: r221519 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 86527011cea..d2528d1645b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-19 Jan Hubicka + + PR ipa/65380 + * ipa-icf.c (sem_function::merge): Do not merge DECL_EXTERNAL symbols. + (sem_variable::merge): Likewise. + 2015-03-19 Martin Liska PR ipa/65465 diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index f68d23cf4dc..360cf17199c 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -814,6 +814,13 @@ sem_function::merge (sem_item *alias_item) bool original_address_matters = original->address_matters_p (); bool alias_address_matters = alias->address_matters_p (); + if (DECL_EXTERNAL (alias->decl)) + { + if (dump_file) + fprintf (dump_file, "Not unifying; alias is external.\n\n"); + return false; + } + if (DECL_NO_INLINE_WARNING_P (original->decl) != DECL_NO_INLINE_WARNING_P (alias->decl)) { @@ -1776,6 +1783,13 @@ sem_variable::merge (sem_item *alias_item) return false; } + if (DECL_EXTERNAL (alias_item->decl)) + { + if (dump_file) + fprintf (dump_file, "Not unifying; alias is external.\n\n"); + return false; + } + sem_variable *alias_var = static_cast (alias_item); varpool_node *original = get_node ();