+2010-05-04 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/43879
+ * tree-ssa-structalias.c (alias_get_name): Use
+ DECL_ASSEMBLER_NAME if available.
+ (create_function_info_for): Return the varinfo node.
+ (ipa_pta_execute): Associate same-body aliases and extra names
+ with their origin nodes varinfo. Dump DECL_ASSEMBLER_NAME.
+
2010-05-04 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (sh_small_register_classes_for_mode_p): Remove
static const char *
alias_get_name (tree decl)
{
- const char *res = get_name (decl);
+ const char *res;
char *temp;
int num_printed = 0;
+ if (DECL_ASSEMBLER_NAME_SET_P (decl))
+ res = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ else
+ res= get_name (decl);
if (res != NULL)
return res;
/* Creation function node for DECL, using NAME, and return the index
of the variable we've created for the function. */
-static unsigned int
+static varinfo_t
create_function_info_for (tree decl, const char *name)
{
struct function *fn = DECL_STRUCT_FUNCTION (decl);
prev_vi = argvi;
}
- return vi->id;
+ return vi;
}
/* Build the constraints. */
for (node = cgraph_nodes; node; node = node->next)
{
+ struct cgraph_node *alias;
+ varinfo_t vi;
+
/* Nodes without a body are not interesting. Especially do not
visit clones at this point for now - we get duplicate decls
there for inline clones at least. */
|| node->clone_of)
continue;
- create_function_info_for (node->decl,
- cgraph_node_name (node));
+ vi = create_function_info_for (node->decl,
+ alias_get_name (node->decl));
+
+ /* Associate the varinfo node with all aliases. */
+ for (alias = node->same_body; alias; alias = alias->next)
+ insert_vi_for_tree (alias->decl, vi);
}
/* Create constraints for global variables and their initializers. */
for (var = varpool_nodes; var; var = var->next)
- get_vi_for_tree (var->decl);
+ {
+ struct varpool_node *alias;
+ varinfo_t vi;
+
+ 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);
+ }
if (dump_file)
{
continue;
if (dump_file)
- fprintf (dump_file,
- "Generating constraints for %s\n",
- cgraph_node_name (node));
+ {
+ fprintf (dump_file,
+ "Generating constraints for %s", cgraph_node_name (node));
+ if (DECL_ASSEMBLER_NAME_SET_P (node->decl))
+ fprintf (dump_file, " (%s)",
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)));
+ fprintf (dump_file, "\n");
+ }
func = DECL_STRUCT_FUNCTION (node->decl);
old_func_decl = current_function_decl;