aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index d5516e6..6f076dc 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -6685,6 +6685,16 @@ associate_varinfo_to_alias (struct cgraph_node *node, void *data)
return false;
}
+/* Associate node with varinfo DATA. Worker for
+ varpool_for_node_and_aliases. */
+static bool
+associate_varinfo_to_alias_1 (struct varpool_node *node, void *data)
+{
+ if (node->alias)
+ insert_vi_for_tree (node->decl, (varinfo_t)data);
+ return false;
+}
+
/* Execute the driver for IPA PTA. */
static unsigned int
ipa_pta_execute (void)
@@ -6716,14 +6726,12 @@ ipa_pta_execute (void)
/* Create constraints for global variables and their initializers. */
for (var = varpool_nodes; var; var = var->next)
{
- struct varpool_node *alias;
varinfo_t vi;
+ if (var->alias)
+ continue;
vi = get_vi_for_tree (var->decl);
-
- /* Associate the varinfo node with all aliases. */
- for (alias = var->extra_name; alias; alias = alias->next)
- insert_vi_for_tree (alias->decl, vi);
+ varpool_for_node_and_aliases (var, associate_varinfo_to_alias_1, vi, true);
}
if (dump_file)