Commit d8903b30 by Diego Novillo Committed by Diego Novillo

tree-dfa.c (dump_variable): If the variable is a pointer SSA_NAME, also dump its…

tree-dfa.c (dump_variable): If the variable is a pointer SSA_NAME, also dump its points-to information.


	* tree-dfa.c (dump_variable): If the variable is a pointer
	SSA_NAME, also dump its points-to information.
	* tree-flow.h (struct ptr_info_def): Add field
	is_dereferenced.
	(dump_points_to_info_for): Declare.
	(debug_points_to_info_for): Declare.
	* tree-optimize.c (init_tree_optimization_passes): Add a
	second alias analysis pass after DOM2.
	Move pass_del_pta to a later spot.
	* tree-ssa-alias.c (compute_points_to_and_addr_escape): Do not
	create a name tags when we find a dereferenced pointer.  Just
	mark the pointer dereferenced.
	(collect_points_to_info_for): Move code to clear points-to
	information to create_name_tags.
	(create_name_tags): New function.
	(compute_flow_sensitive_aliasing): Call it.
	(setup_pointers_and_addressables): Mark type tags for renaming
	here instead of ...
	(create_memory_tag): ... here.
	(merge_pointed_to_info): Do not merge PT_MALLOC attributes.
	(dump_points_to_info_for): Declare extern.
	(debug_points_to_info_for): New function.

From-SVN: r84377
parent 61ebeccf
2004-07-09 Diego Novillo <dnovillo@redhat.com>
* tree-dfa.c (dump_variable): If the variable is a pointer
SSA_NAME, also dump its points-to information.
* tree-flow.h (struct ptr_info_def): Add field
is_dereferenced.
(dump_points_to_info_for): Declare.
(debug_points_to_info_for): Declare.
* tree-optimize.c (init_tree_optimization_passes): Add a
second alias analysis pass after DOM2.
Move pass_del_pta to a later spot.
* tree-ssa-alias.c (compute_points_to_and_addr_escape): Do not
create a name tags when we find a dereferenced pointer. Just
mark the pointer dereferenced.
(collect_points_to_info_for): Move code to clear points-to
information to create_name_tags.
(create_name_tags): New function.
(compute_flow_sensitive_aliasing): Call it.
(setup_pointers_and_addressables): Mark type tags for renaming
here instead of ...
(create_memory_tag): ... here.
(merge_pointed_to_info): Do not merge PT_MALLOC attributes.
(dump_points_to_info_for): Declare extern.
(debug_points_to_info_for): New function.
2004-07-09 Paolo Bonzini <bonzini@gnu.org> 2004-07-09 Paolo Bonzini <bonzini@gnu.org>
* config/arc/arc.md: Switch to DFA-based scheduler description. * config/arc/arc.md: Switch to DFA-based scheduler description.
......
...@@ -534,6 +534,13 @@ void ...@@ -534,6 +534,13 @@ void
dump_variable (FILE *file, tree var) dump_variable (FILE *file, tree var)
{ {
var_ann_t ann; var_ann_t ann;
if (TREE_CODE (var) == SSA_NAME)
{
if (POINTER_TYPE_P (TREE_TYPE (var)))
dump_points_to_info_for (file, var);
var = SSA_NAME_VAR (var);
}
if (var == NULL_TREE) if (var == NULL_TREE)
{ {
...@@ -542,9 +549,6 @@ dump_variable (FILE *file, tree var) ...@@ -542,9 +549,6 @@ dump_variable (FILE *file, tree var)
} }
print_generic_expr (file, var, dump_flags); print_generic_expr (file, var, dump_flags);
if (TREE_CODE (var) == SSA_NAME)
var = SSA_NAME_VAR (var);
ann = var_ann (var); ann = var_ann (var);
......
...@@ -59,6 +59,9 @@ struct ptr_info_def GTY(()) ...@@ -59,6 +59,9 @@ struct ptr_info_def GTY(())
/* Nonzero if the value of this pointer escapes the current function. */ /* Nonzero if the value of this pointer escapes the current function. */
unsigned int value_escapes_p : 1; unsigned int value_escapes_p : 1;
/* Nonzero if this pointer is dereferenced. */
unsigned int is_dereferenced : 1;
/* Set of variables that this pointer may point to. */ /* Set of variables that this pointer may point to. */
bitmap pt_vars; bitmap pt_vars;
...@@ -550,6 +553,8 @@ extern void dump_alias_info (FILE *); ...@@ -550,6 +553,8 @@ extern void dump_alias_info (FILE *);
extern void debug_alias_info (void); extern void debug_alias_info (void);
extern void dump_points_to_info (FILE *); extern void dump_points_to_info (FILE *);
extern void debug_points_to_info (void); extern void debug_points_to_info (void);
extern void dump_points_to_info_for (FILE *, tree);
extern void debug_points_to_info_for (tree);
/* Call-back function for walk_use_def_chains(). At each reaching /* Call-back function for walk_use_def_chains(). At each reaching
definition, a function with this prototype is called. */ definition, a function with this prototype is called. */
......
...@@ -294,7 +294,6 @@ init_tree_optimization_passes (void) ...@@ -294,7 +294,6 @@ init_tree_optimization_passes (void)
NEXT_PASS (pass_may_alias); NEXT_PASS (pass_may_alias);
NEXT_PASS (pass_tail_recursion); NEXT_PASS (pass_tail_recursion);
NEXT_PASS (pass_ch); NEXT_PASS (pass_ch);
NEXT_PASS (pass_del_pta);
NEXT_PASS (pass_profile); NEXT_PASS (pass_profile);
NEXT_PASS (pass_lower_complex); NEXT_PASS (pass_lower_complex);
NEXT_PASS (pass_sra); NEXT_PASS (pass_sra);
...@@ -303,6 +302,7 @@ init_tree_optimization_passes (void) ...@@ -303,6 +302,7 @@ init_tree_optimization_passes (void)
NEXT_PASS (DUP_PASS (pass_redundant_phi)); NEXT_PASS (DUP_PASS (pass_redundant_phi));
NEXT_PASS (DUP_PASS (pass_dce)); NEXT_PASS (DUP_PASS (pass_dce));
NEXT_PASS (pass_dse); NEXT_PASS (pass_dse);
NEXT_PASS (DUP_PASS (pass_may_alias));
NEXT_PASS (DUP_PASS (pass_forwprop)); NEXT_PASS (DUP_PASS (pass_forwprop));
NEXT_PASS (DUP_PASS (pass_phiopt)); NEXT_PASS (DUP_PASS (pass_phiopt));
NEXT_PASS (pass_ccp); NEXT_PASS (pass_ccp);
...@@ -320,6 +320,7 @@ init_tree_optimization_passes (void) ...@@ -320,6 +320,7 @@ init_tree_optimization_passes (void)
NEXT_PASS (pass_tail_calls); NEXT_PASS (pass_tail_calls);
NEXT_PASS (pass_late_warn_uninitialized); NEXT_PASS (pass_late_warn_uninitialized);
NEXT_PASS (pass_warn_function_return); NEXT_PASS (pass_warn_function_return);
NEXT_PASS (pass_del_pta);
NEXT_PASS (pass_del_ssa); NEXT_PASS (pass_del_ssa);
NEXT_PASS (pass_nrv); NEXT_PASS (pass_nrv);
NEXT_PASS (pass_remove_useless_vars); NEXT_PASS (pass_remove_useless_vars);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment