This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ipa-visibility TLC 2/n
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>, ramrad01 at arm dot com, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Sun, 8 Jun 2014 18:49:49 +0200
- Subject: Re: ipa-visibility TLC 2/n
- Authentication-results: sourceware.org; auth=none
- References: <CAGWvnykpdrmfigAjx+gXghA7iWx0mo4_7V1YaAhWMh9OQdx14A at mail dot gmail dot com> <20140528223103 dot GB15880 at kam dot mff dot cuni dot cz> <CAGWvnynmW2d7S=fDWOE0g7CKfcO=y+p0v4=0jwhTAuOx+pVbYQ at mail dot gmail dot com> <20140528231723 dot GA31990 at kam dot mff dot cuni dot cz> <87bnuh9fdo dot fsf at talisman dot default> <20140529171214 dot GB32218 at kam dot mff dot cuni dot cz> <877g53ag1p dot fsf at talisman dot default> <CAGWvnyn1b_gDjoE9rfie0Q66Jmv7pYYMq+9NtNn5=cdJ8NPzrw at mail dot gmail dot com>
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));
}