2014-10-24 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / varpool.c
blobebb72bd185502741caee0e0cb869aaef79b82fa9
1 /* Callgraph handling code.
2 Copyright (C) 2003-2014 Free Software Foundation, Inc.
3 Contributed by Jan Hubicka
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 3, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
21 #include "config.h"
22 #include "system.h"
23 #include "coretypes.h"
24 #include "tm.h"
25 #include "tree.h"
26 #include "varasm.h"
27 #include "cgraph.h"
28 #include "langhooks.h"
29 #include "diagnostic-core.h"
30 #include "hashtab.h"
31 #include "timevar.h"
32 #include "debug.h"
33 #include "target.h"
34 #include "output.h"
35 #include "gimple-expr.h"
36 #include "flags.h"
37 #include "tree-ssa-alias.h"
38 #include "gimple.h"
39 #include "lto-streamer.h"
40 #include "hash-set.h"
42 const char * const tls_model_names[]={"none", "tls-emulated", "tls-real",
43 "tls-global-dynamic", "tls-local-dynamic",
44 "tls-initial-exec", "tls-local-exec"};
46 /* List of hooks triggered on varpool_node events. */
47 struct varpool_node_hook_list {
48 varpool_node_hook hook;
49 void *data;
50 struct varpool_node_hook_list *next;
53 /* Register HOOK to be called with DATA on each removed node. */
54 varpool_node_hook_list *
55 symbol_table::add_varpool_removal_hook (varpool_node_hook hook, void *data)
57 varpool_node_hook_list *entry;
58 varpool_node_hook_list **ptr = &m_first_varpool_removal_hook;
60 entry = (varpool_node_hook_list *) xmalloc (sizeof (*entry));
61 entry->hook = hook;
62 entry->data = data;
63 entry->next = NULL;
64 while (*ptr)
65 ptr = &(*ptr)->next;
66 *ptr = entry;
67 return entry;
70 /* Remove ENTRY from the list of hooks called on removing nodes. */
71 void
72 symbol_table::remove_varpool_removal_hook (varpool_node_hook_list *entry)
74 varpool_node_hook_list **ptr = &m_first_varpool_removal_hook;
76 while (*ptr != entry)
77 ptr = &(*ptr)->next;
78 *ptr = entry->next;
79 free (entry);
82 /* Call all node removal hooks. */
83 void
84 symbol_table::call_varpool_removal_hooks (varpool_node *node)
86 varpool_node_hook_list *entry = m_first_varpool_removal_hook;
87 while (entry)
89 entry->hook (node, entry->data);
90 entry = entry->next;
94 /* Register HOOK to be called with DATA on each inserted node. */
95 varpool_node_hook_list *
96 symbol_table::add_varpool_insertion_hook (varpool_node_hook hook, void *data)
98 varpool_node_hook_list *entry;
99 varpool_node_hook_list **ptr = &m_first_varpool_insertion_hook;
101 entry = (varpool_node_hook_list *) xmalloc (sizeof (*entry));
102 entry->hook = hook;
103 entry->data = data;
104 entry->next = NULL;
105 while (*ptr)
106 ptr = &(*ptr)->next;
107 *ptr = entry;
108 return entry;
111 /* Remove ENTRY from the list of hooks called on inserted nodes. */
112 void
113 symbol_table::remove_varpool_insertion_hook (varpool_node_hook_list *entry)
115 varpool_node_hook_list **ptr = &m_first_varpool_insertion_hook;
117 while (*ptr != entry)
118 ptr = &(*ptr)->next;
119 *ptr = entry->next;
120 free (entry);
123 /* Call all node insertion hooks. */
124 void
125 symbol_table::call_varpool_insertion_hooks (varpool_node *node)
127 varpool_node_hook_list *entry = m_first_varpool_insertion_hook;
128 while (entry)
130 entry->hook (node, entry->data);
131 entry = entry->next;
135 /* Allocate new callgraph node and insert it into basic data structures. */
137 varpool_node *
138 varpool_node::create_empty (void)
140 varpool_node *node = ggc_cleared_alloc<varpool_node> ();
141 node->type = SYMTAB_VARIABLE;
142 return node;
145 /* Return varpool node assigned to DECL. Create new one when needed. */
146 varpool_node *
147 varpool_node::get_create (tree decl)
149 varpool_node *node = varpool_node::get (decl);
150 gcc_checking_assert (TREE_CODE (decl) == VAR_DECL);
151 if (node)
152 return node;
154 node = varpool_node::create_empty ();
155 node->decl = decl;
156 node->register_symbol ();
157 return node;
160 /* Remove variable from symbol table. */
162 void
163 varpool_node::remove (void)
165 symtab->call_varpool_removal_hooks (this);
166 unregister ();
168 /* When streaming we can have multiple nodes associated with decl. */
169 if (symtab->state == LTO_STREAMING)
171 /* Keep constructor when it may be used for folding. We remove
172 references to external variables before final compilation. */
173 else if (DECL_INITIAL (decl) && DECL_INITIAL (decl) != error_mark_node
174 && !ctor_useable_for_folding_p ())
175 remove_initializer ();
176 ggc_free (this);
179 /* Remove node initializer when it is no longer needed. */
180 void
181 varpool_node::remove_initializer (void)
183 if (DECL_INITIAL (decl)
184 && !DECL_IN_CONSTANT_POOL (decl)
185 /* Keep vtables for BINFO folding. */
186 && !DECL_VIRTUAL_P (decl)
187 /* FIXME: http://gcc.gnu.org/PR55395 */
188 && debug_info_level == DINFO_LEVEL_NONE
189 /* When doing declaration merging we have duplicate
190 entries for given decl. Do not attempt to remove
191 the boides, or we will end up remiving
192 wrong one. */
193 && symtab->state != LTO_STREAMING)
194 DECL_INITIAL (decl) = error_mark_node;
197 /* Dump given varpool node to F. */
198 void
199 varpool_node::dump (FILE *f)
201 dump_base (f);
202 fprintf (f, " Availability: %s\n",
203 symtab->function_flags_ready
204 ? cgraph_availability_names[get_availability ()]
205 : "not-ready");
206 fprintf (f, " Varpool flags:");
207 if (DECL_INITIAL (decl))
208 fprintf (f, " initialized");
209 if (output)
210 fprintf (f, " output");
211 if (used_by_single_function)
212 fprintf (f, " used-by-single-function");
213 if (TREE_READONLY (decl))
214 fprintf (f, " read-only");
215 if (ctor_useable_for_folding_p ())
216 fprintf (f, " const-value-known");
217 if (writeonly)
218 fprintf (f, " write-only");
219 if (tls_model)
220 fprintf (f, " %s", tls_model_names [tls_model]);
221 fprintf (f, "\n");
225 /* Dump given varpool node to stderr. */
226 void varpool_node::debug (void)
228 varpool_node::dump (stderr);
231 /* Dump the variable pool to F. */
232 void
233 varpool_node::dump_varpool (FILE *f)
235 varpool_node *node;
237 fprintf (f, "variable pool:\n\n");
238 FOR_EACH_VARIABLE (node)
239 node->dump (f);
242 /* Dump the variable pool to stderr. */
244 DEBUG_FUNCTION void
245 varpool_node::debug_varpool (void)
247 dump_varpool (stderr);
250 /* Given an assembler name, lookup node. */
251 varpool_node *
252 varpool_node::get_for_asmname (tree asmname)
254 if (symtab_node *node = symtab_node::get_for_asmname (asmname))
255 return dyn_cast <varpool_node *> (node);
256 else
257 return NULL;
260 /* When doing LTO, read variable's constructor from disk if
261 it is not already present. */
263 tree
264 varpool_node::get_constructor (void)
266 lto_file_decl_data *file_data;
267 const char *data, *name;
268 size_t len;
270 if (DECL_INITIAL (decl) != error_mark_node
271 || !in_lto_p)
272 return DECL_INITIAL (decl);
274 timevar_push (TV_IPA_LTO_CTORS_IN);
276 file_data = lto_file_data;
277 name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
279 /* We may have renamed the declaration, e.g., a static function. */
280 name = lto_get_decl_name_mapping (file_data, name);
282 data = lto_get_section_data (file_data, LTO_section_function_body,
283 name, &len);
284 if (!data)
285 fatal_error ("%s: section %s is missing",
286 file_data->file_name,
287 name);
289 lto_input_variable_constructor (file_data, this, data);
290 lto_stats.num_function_bodies++;
291 lto_free_section_data (file_data, LTO_section_function_body, name,
292 data, len);
293 lto_free_function_in_decl_state_for_node (this);
294 timevar_pop (TV_IPA_LTO_CTORS_IN);
295 return DECL_INITIAL (decl);
298 /* Return true if variable has constructor that can be used for folding. */
300 bool
301 varpool_node::ctor_useable_for_folding_p (void)
303 varpool_node *real_node = this;
305 if (real_node->alias && real_node->definition)
306 real_node = ultimate_alias_target ();
308 if (TREE_CODE (decl) == CONST_DECL
309 || DECL_IN_CONSTANT_POOL (decl))
310 return true;
311 if (TREE_THIS_VOLATILE (decl))
312 return false;
314 /* If we do not have a constructor, we can't use it. */
315 if (DECL_INITIAL (real_node->decl) == error_mark_node
316 && !real_node->lto_file_data)
317 return false;
319 /* Avoid attempts to load constructors that was not streamed. */
320 if (flag_ltrans && DECL_INITIAL (real_node->decl) == error_mark_node
321 && real_node->body_removed)
322 return false;
324 /* Vtables are defined by their types and must match no matter of interposition
325 rules. */
326 if (DECL_VIRTUAL_P (decl))
328 /* The C++ front end creates VAR_DECLs for vtables of typeinfo
329 classes not defined in the current TU so that it can refer
330 to them from typeinfo objects. Avoid returning NULL_TREE. */
331 return DECL_INITIAL (real_node->decl) != NULL;
334 /* Alias of readonly variable is also readonly, since the variable is stored
335 in readonly memory. We also accept readonly aliases of non-readonly
336 locations assuming that user knows what he is asking for. */
337 if (!TREE_READONLY (decl) && !TREE_READONLY (real_node->decl))
338 return false;
340 /* Variables declared 'const' without an initializer
341 have zero as the initializer if they may not be
342 overridden at link or run time.
344 It is actually requirement for C++ compiler to optimize const variables
345 consistently. As a GNU extension, do not enfore this rule for user defined
346 weak variables, so we support interposition on:
347 static const int dummy = 0;
348 extern const int foo __attribute__((__weak__, __alias__("dummy")));
350 if ((!DECL_INITIAL (real_node->decl)
351 || (DECL_WEAK (decl) && !DECL_COMDAT (decl)))
352 && (DECL_EXTERNAL (decl) || decl_replaceable_p (decl)))
353 return false;
355 /* Variables declared `const' with an initializer are considered
356 to not be overwritable with different initializer by default.
358 ??? Previously we behaved so for scalar variables but not for array
359 accesses. */
360 return true;
363 /* If DECLARATION is constant variable and its initial value is known
364 (so we can do constant folding), return its constructor (DECL_INITIAL).
365 This may be an expression or NULL when DECL is initialized to 0.
366 Return ERROR_MARK_NODE otherwise.
368 In LTO this may actually trigger reading the constructor from disk.
369 For this reason varpool_ctor_useable_for_folding_p should be used when
370 the actual constructor value is not needed. */
372 tree
373 ctor_for_folding (tree decl)
375 varpool_node *node, *real_node;
376 tree real_decl;
378 if (TREE_CODE (decl) != VAR_DECL
379 && TREE_CODE (decl) != CONST_DECL)
380 return error_mark_node;
382 if (TREE_CODE (decl) == CONST_DECL
383 || DECL_IN_CONSTANT_POOL (decl))
384 return DECL_INITIAL (decl);
386 if (TREE_THIS_VOLATILE (decl))
387 return error_mark_node;
389 /* Do not care about automatic variables. Those are never initialized
390 anyway, because gimplifier exapnds the code. */
391 if (!TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
393 gcc_assert (!TREE_PUBLIC (decl));
394 return error_mark_node;
397 gcc_assert (TREE_CODE (decl) == VAR_DECL);
399 real_node = node = varpool_node::get (decl);
400 if (node)
402 real_node = node->ultimate_alias_target ();
403 real_decl = real_node->decl;
405 else
406 real_decl = decl;
408 /* See if we are dealing with alias.
409 In most cases alias is just alternative symbol pointing to a given
410 constructor. This allows us to use interposition rules of DECL
411 constructor of REAL_NODE. However weakrefs are special by being just
412 alternative name of their target (if defined). */
413 if (decl != real_decl)
415 gcc_assert (!DECL_INITIAL (decl)
416 || (node->alias && node->get_alias_target () == real_node)
417 || DECL_INITIAL (decl) == error_mark_node);
418 if (node->weakref)
420 node = node->get_alias_target ();
421 decl = node->decl;
425 if ((!DECL_VIRTUAL_P (real_decl)
426 || DECL_INITIAL (real_decl) == error_mark_node
427 || !DECL_INITIAL (real_decl))
428 && (!node || !node->ctor_useable_for_folding_p ()))
429 return error_mark_node;
431 /* OK, we can return constructor. See if we need to fetch it from disk
432 in LTO mode. */
433 if (DECL_INITIAL (real_decl) != error_mark_node
434 || !in_lto_p)
435 return DECL_INITIAL (real_decl);
436 return real_node->get_constructor ();
439 /* Add the variable DECL to the varpool.
440 Unlike finalize_decl function is intended to be used
441 by middle end and allows insertion of new variable at arbitrary point
442 of compilation. */
443 void
444 varpool_node::add (tree decl)
446 varpool_node *node;
447 varpool_node::finalize_decl (decl);
448 node = varpool_node::get_create (decl);
449 symtab->call_varpool_insertion_hooks (node);
450 if (node->externally_visible_p ())
451 node->externally_visible = true;
452 if (lookup_attribute ("no_reorder", DECL_ATTRIBUTES (decl)))
453 node->no_reorder = 1;
456 /* Return variable availability. See cgraph.h for description of individual
457 return values. */
458 enum availability
459 varpool_node::get_availability (void)
461 if (!definition)
462 return AVAIL_NOT_AVAILABLE;
463 if (!TREE_PUBLIC (decl))
464 return AVAIL_AVAILABLE;
465 if (DECL_IN_CONSTANT_POOL (decl)
466 || DECL_VIRTUAL_P (decl))
467 return AVAIL_AVAILABLE;
468 if (alias && weakref)
470 enum availability avail;
472 ultimate_alias_target (&avail)->get_availability ();
473 return avail;
475 /* If the variable can be overwritten, return OVERWRITABLE. Takes
476 care of at least one notable extension - the COMDAT variables
477 used to share template instantiations in C++. */
478 if (decl_replaceable_p (decl)
479 || DECL_EXTERNAL (decl))
480 return AVAIL_INTERPOSABLE;
481 return AVAIL_AVAILABLE;
484 void
485 varpool_node::analyze (void)
487 /* When reading back varpool at LTO time, we re-construct the queue in order
488 to have "needed" list right by inserting all needed nodes into varpool.
489 We however don't want to re-analyze already analyzed nodes. */
490 if (!analyzed)
492 gcc_assert (!in_lto_p || symtab->function_flags_ready);
493 /* Compute the alignment early so function body expanders are
494 already informed about increased alignment. */
495 align_variable (decl, 0);
497 if (alias)
498 resolve_alias (varpool_node::get (alias_target));
499 else if (DECL_INITIAL (decl))
500 record_references_in_initializer (decl, analyzed);
501 analyzed = true;
504 /* Assemble thunks and aliases associated to varpool node. */
506 void
507 varpool_node::assemble_aliases (void)
509 ipa_ref *ref;
511 FOR_EACH_ALIAS (this, ref)
513 varpool_node *alias = dyn_cast <varpool_node *> (ref->referring);
514 do_assemble_alias (alias->decl,
515 DECL_ASSEMBLER_NAME (decl));
516 alias->assemble_aliases ();
520 /* Output one variable, if necessary. Return whether we output it. */
522 bool
523 varpool_node::assemble_decl (void)
525 /* Aliases are outout when their target is produced or by
526 output_weakrefs. */
527 if (alias)
528 return false;
530 /* Constant pool is output from RTL land when the reference
531 survive till this level. */
532 if (DECL_IN_CONSTANT_POOL (decl) && TREE_ASM_WRITTEN (decl))
533 return false;
535 /* Decls with VALUE_EXPR should not be in the varpool at all. They
536 are not real variables, but just info for debugging and codegen.
537 Unfortunately at the moment emutls is not updating varpool correctly
538 after turning real vars into value_expr vars. */
539 if (DECL_HAS_VALUE_EXPR_P (decl)
540 && !targetm.have_tls)
541 return false;
543 /* Hard register vars do not need to be output. */
544 if (DECL_HARD_REGISTER (decl))
545 return false;
547 gcc_checking_assert (!TREE_ASM_WRITTEN (decl)
548 && TREE_CODE (decl) == VAR_DECL
549 && !DECL_HAS_VALUE_EXPR_P (decl));
551 if (!in_other_partition
552 && !DECL_EXTERNAL (decl))
554 get_constructor ();
555 assemble_variable (decl, 0, 1, 0);
556 gcc_assert (TREE_ASM_WRITTEN (decl));
557 gcc_assert (definition);
558 assemble_aliases ();
559 return true;
562 return false;
565 /* Add NODE to queue starting at FIRST.
566 The queue is linked via AUX pointers and terminated by pointer to 1. */
568 static void
569 enqueue_node (varpool_node *node, varpool_node **first)
571 if (node->aux)
572 return;
573 gcc_checking_assert (*first);
574 node->aux = *first;
575 *first = node;
578 /* Optimization of function bodies might've rendered some variables as
579 unnecessary so we want to avoid these from being compiled. Re-do
580 reachability starting from variables that are either externally visible
581 or was referred from the asm output routines. */
583 void
584 symbol_table::remove_unreferenced_decls (void)
586 varpool_node *next, *node;
587 varpool_node *first = (varpool_node *)(void *)1;
588 int i;
589 ipa_ref *ref = NULL;
590 hash_set<varpool_node *> referenced;
592 if (seen_error ())
593 return;
595 if (dump_file)
596 fprintf (dump_file, "Trivially needed variables:");
597 FOR_EACH_DEFINED_VARIABLE (node)
599 if (node->analyzed
600 && (!node->can_remove_if_no_refs_p ()
601 /* We just expanded all function bodies. See if any of
602 them needed the variable. */
603 || DECL_RTL_SET_P (node->decl)))
605 enqueue_node (node, &first);
606 if (dump_file)
607 fprintf (dump_file, " %s", node->asm_name ());
610 while (first != (varpool_node *)(void *)1)
612 node = first;
613 first = (varpool_node *)first->aux;
615 if (node->same_comdat_group)
617 symtab_node *next;
618 for (next = node->same_comdat_group;
619 next != node;
620 next = next->same_comdat_group)
622 varpool_node *vnext = dyn_cast <varpool_node *> (next);
623 if (vnext && vnext->analyzed && !next->comdat_local_p ())
624 enqueue_node (vnext, &first);
627 for (i = 0; node->iterate_reference (i, ref); i++)
629 varpool_node *vnode = dyn_cast <varpool_node *> (ref->referred);
630 if (vnode
631 && !vnode->in_other_partition
632 && (!DECL_EXTERNAL (ref->referred->decl)
633 || vnode->alias)
634 && vnode->analyzed)
635 enqueue_node (vnode, &first);
636 else
637 referenced.add (node);
640 if (dump_file)
641 fprintf (dump_file, "\nRemoving variables:");
642 for (node = first_defined_variable (); node; node = next)
644 next = next_defined_variable (node);
645 if (!node->aux && !node->no_reorder)
647 if (dump_file)
648 fprintf (dump_file, " %s", node->asm_name ());
649 if (referenced.contains(node))
650 node->remove_initializer ();
651 else
652 node->remove ();
656 if (dump_file)
657 fprintf (dump_file, "\n");
660 /* For variables in named sections make sure get_variable_section
661 is called before we switch to those sections. Then section
662 conflicts between read-only and read-only requiring relocations
663 sections can be resolved. */
664 void
665 varpool_node::finalize_named_section_flags (void)
667 if (!TREE_ASM_WRITTEN (decl)
668 && !alias
669 && !in_other_partition
670 && !DECL_EXTERNAL (decl)
671 && TREE_CODE (decl) == VAR_DECL
672 && !DECL_HAS_VALUE_EXPR_P (decl)
673 && get_section ())
674 get_variable_section (decl, false);
677 /* Output all variables enqueued to be assembled. */
678 bool
679 symbol_table::output_variables (void)
681 bool changed = false;
682 varpool_node *node;
684 if (seen_error ())
685 return false;
687 remove_unreferenced_decls ();
689 timevar_push (TV_VAROUT);
691 FOR_EACH_DEFINED_VARIABLE (node)
693 /* Handled in output_in_order. */
694 if (node->no_reorder)
695 continue;
697 node->finalize_named_section_flags ();
700 FOR_EACH_DEFINED_VARIABLE (node)
702 /* Handled in output_in_order. */
703 if (node->no_reorder)
704 continue;
705 if (node->assemble_decl ())
706 changed = true;
708 timevar_pop (TV_VAROUT);
709 return changed;
712 /* Create a new global variable of type TYPE. */
713 tree
714 add_new_static_var (tree type)
716 tree new_decl;
717 varpool_node *new_node;
719 new_decl = create_tmp_var_raw (type, NULL);
720 DECL_NAME (new_decl) = create_tmp_var_name (NULL);
721 TREE_READONLY (new_decl) = 0;
722 TREE_STATIC (new_decl) = 1;
723 TREE_USED (new_decl) = 1;
724 DECL_CONTEXT (new_decl) = NULL_TREE;
725 DECL_ABSTRACT_P (new_decl) = false;
726 lang_hooks.dup_lang_specific_decl (new_decl);
727 new_node = varpool_node::get_create (new_decl);
728 varpool_node::finalize_decl (new_decl);
730 return new_node->decl;
733 /* Attempt to mark ALIAS as an alias to DECL. Return TRUE if successful.
734 Extra name aliases are output whenever DECL is output. */
736 varpool_node *
737 varpool_node::create_alias (tree alias, tree decl)
739 varpool_node *alias_node;
741 gcc_assert (TREE_CODE (decl) == VAR_DECL);
742 gcc_assert (TREE_CODE (alias) == VAR_DECL);
743 alias_node = varpool_node::get_create (alias);
744 alias_node->alias = true;
745 alias_node->definition = true;
746 alias_node->alias_target = decl;
747 if (lookup_attribute ("weakref", DECL_ATTRIBUTES (alias)) != NULL)
748 alias_node->weakref = true;
749 return alias_node;
752 /* Attempt to mark ALIAS as an alias to DECL. Return TRUE if successful.
753 Extra name aliases are output whenever DECL is output. */
755 varpool_node *
756 varpool_node::create_extra_name_alias (tree alias, tree decl)
758 varpool_node *alias_node;
760 #ifndef ASM_OUTPUT_DEF
761 /* If aliases aren't supported by the assembler, fail. */
762 return NULL;
763 #endif
764 alias_node = varpool_node::create_alias (alias, decl);
765 alias_node->cpp_implicit_alias = true;
767 /* Extra name alias mechanizm creates aliases really late
768 via DECL_ASSEMBLER_NAME mechanizm.
769 This is unfortunate because they are not going through the
770 standard channels. Ensure they get output. */
771 if (symtab->cpp_implicit_aliases_done)
772 alias_node->resolve_alias (varpool_node::get_create (decl));
773 return alias_node;
776 /* Call calback on varpool symbol and aliases associated to varpool symbol.
777 When INCLUDE_OVERWRITABLE is false, overwritable aliases and thunks are
778 skipped. */
780 bool
781 varpool_node::call_for_node_and_aliases (bool (*callback) (varpool_node *,
782 void *),
783 void *data,
784 bool include_overwritable)
786 ipa_ref *ref;
788 if (callback (this, data))
789 return true;
791 FOR_EACH_ALIAS (this, ref)
793 varpool_node *alias = dyn_cast <varpool_node *> (ref->referring);
794 if (include_overwritable
795 || alias->get_availability () > AVAIL_INTERPOSABLE)
796 if (alias->call_for_node_and_aliases (callback, data,
797 include_overwritable))
798 return true;
800 return false;