Hi,
this is second part of fix - it just makes ipa-visibility to work less hard when
initializer already contains local aliases. I noticed this when debugging the
original
issue.
Bootstrapped/regtested rs6000-aix, comitted.
Honza
* ipa-visibility.c: Include varasm.h
(can_replace_by_local_alias): Ceck decl_binds_to_current_def_p.
Index: ipa-visibility.c
===================================================================
--- ipa-visibility.c (revision 211120)
+++ ipa-visibility.c (working copy)
@@ -82,6 +82,7 @@
#include "pointer-set.h"
#include "calls.h"
#include "gimple-expr.h"
+#include "varasm.h"
/* Return true when NODE can not be local. Worker for cgraph_local_node_p. */
@@ -340,6 +341,7 @@
can_replace_by_local_alias (symtab_node *node)
{
return (symtab_node_availability (node) > AVAIL_OVERWRITABLE
+ && !decl_binds_to_current_def_p (node->decl)
&& !symtab_can_be_discarded (node));
}