+2013-08-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * cgraphunit.c (handle_alias_pairs): Reset the alias flag after the
+ error message is issued for an alias to undefined symbol.
+
2013-08-18 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_create_indirect_edge): Discover
/* Translate the ugly representation of aliases as alias pairs into nice
representation in callgraph. We don't handle all cases yet,
- unforutnately. */
+ unfortunately. */
static void
handle_alias_pairs (void)
{
symtab_node target_node = symtab_node_for_asm (p->target);
- /* Weakrefs with target not defined in current unit are easy to handle; they
- behave just as external variables except we need to note the alias flag
- to later output the weakref pseudo op into asm file. */
- if (!target_node && lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)) != NULL)
+ /* Weakrefs with target not defined in current unit are easy to handle:
+ they behave just as external variables except we need to note the
+ alias flag to later output the weakref pseudo op into asm file. */
+ if (!target_node
+ && lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)) != NULL)
{
symtab_node node = symtab_get_node (p->decl);
if (node)
else if (!target_node)
{
error ("%q+D aliased to undefined symbol %qE", p->decl, p->target);
+ symtab_node node = symtab_get_node (p->decl);
+ if (node)
+ node->symbol.alias = false;
alias_pairs->unordered_remove (i);
continue;
}
+2013-08-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/specs/linker_alias.ads: New test.
+
2013-08-16 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/58164
--- /dev/null
+-- { dg-do compile }
+
+package Linker_Alias is
+
+ Var : Integer; -- { dg-error "aliased to undefined symbol" }
+ pragma Export (C, Var, "my_var");
+ pragma Linker_Alias (Var, "var2");
+
+end Linker_Alias;