}
}
+/* 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;
sem_function::init (void)
{
if (in_lto_p)
- get_node ()->get_body ();
+ get_node ()->get_untransformed_body ();
tree fndecl = node->decl;
function *func = DECL_STRUCT_FUNCTION (fndecl);
{
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 ();