From: Martin Liska Date: Tue, 11 Nov 2014 14:58:21 +0000 (+0100) Subject: re PR bootstrap/63622 (Bootstrap fails on x86_64-apple-darwin1[34] after revision... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f657d66569fa873772fb624a4413dfa2014d700c;p=gcc.git re PR bootstrap/63622 (Bootstrap fails on x86_64-apple-darwin1[34] after revision r216305) PR ipa/63622 PR ipa/63795 * g++.dg/ipa/ipa-icf-4.C: Add more precise dump scan. * g++.dg/ipa/ipa-icf-5.C: Add condition for target with symbol alias support. * ipa-icf.c (sem_function::merge): Add new target symbol alias support guard. (sem_variable::merge): Likewise. * ipa-icf.h (target_supports_symbol_aliases_p): New function. From-SVN: r217355 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2d57bd3cc93..73323efb676 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2014-11-11 Martin Liska + + PR ipa/63622 + PR ipa/63795 + * ipa-icf.c (sem_function::merge): Add new target symbol alias + support guard. + (sem_variable::merge): Likewise. + * ipa-icf.h (target_supports_symbol_aliases_p): New function. + 2014-11-11 Richard Biener * match.pd: Implement patterns from associate_plusminus diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 84cc0ca0ba1..92ec82d7c8a 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -191,6 +191,18 @@ sem_item::dump (void) } } +/* Return true if target supports alias symbols. */ + +bool +sem_item::target_supports_symbol_aliases_p (void) +{ +#if !defined (ASM_OUTPUT_DEF) || (!defined(ASM_OUTPUT_WEAK_ALIAS) && !defined (ASM_WEAKEN_DECL)) + return false; +#else + return true; +#endif +} + /* Semantic function constructor that uses STACK as bitmap memory stack. */ sem_function::sem_function (bitmap_obstack *stack): sem_item (FUNC, stack), @@ -589,7 +601,8 @@ sem_function::merge (sem_item *alias_item) redirect_callers = false; } - if (create_alias && DECL_COMDAT_GROUP (alias->decl)) + if (create_alias && (DECL_COMDAT_GROUP (alias->decl) + || !sem_item::target_supports_symbol_aliases_p ())) { create_alias = false; create_thunk = true; @@ -605,6 +618,14 @@ sem_function::merge (sem_item *alias_item) local_original = dyn_cast (original->noninterposable_alias ()); + if (!local_original) + { + if (dump_file) + fprintf (dump_file, "Noninterposable alias cannot be created.\n\n"); + + return false; + } + if (redirect_callers) { /* If alias is non-overwritable then @@ -649,7 +670,7 @@ sem_function::merge (sem_item *alias_item) alias->resolve_alias (original); /* Workaround for PR63566 that forces equal calling convention - to be used. */ + to be used. */ alias->local.local = false; original->local.local = false; @@ -1155,6 +1176,13 @@ sem_variable::merge (sem_item *alias_item) { gcc_assert (alias_item->type == VAR); + if (!sem_item::target_supports_symbol_aliases_p ()) + { + if (dump_file) + fprintf (dump_file, "Symbol aliases are not supported by target\n\n"); + return false; + } + sem_variable *alias_var = static_cast (alias_item); varpool_node *original = get_node (); diff --git a/gcc/ipa-icf.h b/gcc/ipa-icf.h index d8e7b163a16..046e858c6a8 100644 --- a/gcc/ipa-icf.h +++ b/gcc/ipa-icf.h @@ -138,9 +138,11 @@ public: /* Return base tree that can be used for compatible_types_p and contains_polymorphic_type_p comparison. */ - static bool get_base_types (tree *t1, tree *t2); + /* Return true if target supports alias symbols. */ + bool target_supports_symbol_aliases_p (void); + /* Item type. */ sem_item_type type; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3672bc62823..c3f633a985a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2014-11-11 Martin Liska + + PR ipa/63622 + PR ipa/63795 + * g++.dg/ipa/ipa-icf-4.C: Add more precise dump scan. + * g++.dg/ipa/ipa-icf-5.C: Add condition for target + with symbol alias support. + 2014-11-10 Andi Kleen * c-c++-common/cilk-plus/AN/misc.c (main): Handle diff --git a/gcc/testsuite/g++.dg/ipa/ipa-icf-4.C b/gcc/testsuite/g++.dg/ipa/ipa-icf-4.C index 94342896773..912e06b9b43 100644 --- a/gcc/testsuite/g++.dg/ipa/ipa-icf-4.C +++ b/gcc/testsuite/g++.dg/ipa/ipa-icf-4.C @@ -43,6 +43,6 @@ int main() return 123; } -/* { dg-final { scan-ipa-dump "Varpool alias has been created" "icf" } } */ +/* { dg-final { scan-ipa-dump "\(Varpool alias has been created\)|\(Symbol aliases are not supported by target\)" "icf" } } */ /* { dg-final { scan-ipa-dump "Equal symbols: 6" "icf" } } */ /* { dg-final { cleanup-ipa-dump "icf" } } */ diff --git a/gcc/testsuite/g++.dg/ipa/ipa-icf-5.C b/gcc/testsuite/g++.dg/ipa/ipa-icf-5.C index f8358141fd4..57dcb782fc4 100644 --- a/gcc/testsuite/g++.dg/ipa/ipa-icf-5.C +++ b/gcc/testsuite/g++.dg/ipa/ipa-icf-5.C @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-require-visibility "" } */ +/* { dg-require-alias "" } */ /* { dg-options "-O2 -fdump-ipa-icf" } */ struct test