+2014-11-11 Martin Liska <mliska@suse.cz>
+
+ 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 <rguenther@suse.de>
* match.pd: Implement patterns from associate_plusminus
}
}
+/* 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),
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;
local_original
= dyn_cast <cgraph_node *> (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
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;
{
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<sem_variable *> (alias_item);
varpool_node *original = get_node ();
/* 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;
+2014-11-11 Martin Liska <mliska@suse.cz>
+
+ 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 <ak@linux.intel.com>
* c-c++-common/cilk-plus/AN/misc.c (main): Handle
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" } } */