Hi,
this patch fixes ordering issue in varpool.c that, while removing alias
it first removes link to its target and then tries to copy the constructor.
Bootstrapped/regtested x86_64-linux, commited.
PR ipa/61548
* varpool.c (varpool_node::remove): Fix order of variables.
Index: varpool.c
===================================================================
--- varpool.c (revision 220417)
+++ varpool.c (working copy)
@@ -195,7 +195,6 @@ void
varpool_node::remove (void)
{
symtab->call_varpool_removal_hooks (this);
- unregister ();
/* When streaming we can have multiple nodes associated with decl. */
if (symtab->state == LTO_STREAMING)
@@ -205,6 +204,8 @@ varpool_node::remove (void)
else if (DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node
&& !ctor_useable_for_folding_p ())
remove_initializer ();
+
+ unregister ();
ggc_free (this);
}