+2011-06-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/49493
+ * tree-ssa-structalias.c (get_constraint_for_ssa_var):
+ Refer to the alias target of variables.
+ (associate_varinfo_to_alias_1): Remove.
+ (ipa_pta_execute): Do not associate aliases with anything.
+ * cgraph.h (varpool_alias_aliased_node): Fix cut&paste errors.
+ (cgraph_function_node): Likewise.
+ (cgraph_function_or_thunk_node): Likewise.
+ (varpool_variable_node): Likewise.
+
2011-06-22 Nathan Sidwell <nathan@codesourcery.com>
* config/arm/arm.h (OPTION_DEFAULT_SPECS): Fix -mtls-dialect
ipa_ref_list_reference_iterate (&n->ref_list, 0, ref);
gcc_checking_assert (ref->use == IPA_REF_ALIAS);
- if (ref->refered_type == IPA_REF_CGRAPH)
+ if (ref->refered_type == IPA_REF_VARPOOL)
return ipa_ref_varpool_node (ref);
return NULL;
}
*availability = a;
}
}
- if (*availability)
+ if (availability)
*availability = AVAIL_NOT_AVAILABLE;
return NULL;
}
*availability = a;
}
}
- if (*availability)
+ if (availability)
*availability = AVAIL_NOT_AVAILABLE;
return NULL;
}
*availability = a;
}
}
- if (*availability)
+ if (availability)
*availability = AVAIL_NOT_AVAILABLE;
return NULL;
}
+2011-06-22 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/49493
+ * gcc.dg/ipa/ipa-pta-17.c: New testcase.
+
2011-06-22 Jason Merrill <jason@redhat.com>
PR c++/49260
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fipa-pta" } */
+
+static int i;
+extern int j __attribute__ ((alias ("i")));
+int *p = &j;
return;
}
+ /* For global variables resort to the alias target. */
+ if (TREE_CODE (t) == VAR_DECL
+ && (TREE_STATIC (t) || DECL_EXTERNAL (t)))
+ {
+ struct varpool_node *node = varpool_get_node (t);
+ if (node && node->alias)
+ {
+ node = varpool_variable_node (node, NULL);
+ t = node->decl;
+ }
+ }
+
vi = get_vi_for_tree (t);
cexpr.var = vi->id;
cexpr.type = SCALAR;
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)
/* Create constraints for global variables and their initializers. */
for (var = varpool_nodes; var; var = var->next)
{
- varinfo_t vi;
if (var->alias)
continue;
- vi = get_vi_for_tree (var->decl);
- varpool_for_node_and_aliases (var, associate_varinfo_to_alias_1, vi, true);
+ get_vi_for_tree (var->decl);
}
if (dump_file)