Commit 91deb937 by Richard Guenther Committed by Richard Biener

tree-ssa-live.c (remove_unused_locals): Do not remove heap variables.

2009-07-02  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-live.c (remove_unused_locals): Do not remove
	heap variables.
	* tree-ssa-structalias.c (handle_lhs_call): Delay setting
	of DECL_EXTERNAL for HEAP variables.
	(compute_points_to_sets): Set DECL_EXTERNAL for escaped
	HEAP variables.  Do not adjust RESTRICT vars.
	(find_what_var_points_to): Nobody cares if something
	points to READONLY.

From-SVN: r149170
parent 3e37f41e
2009-07-02 Richard Guenther <rguenther@suse.de>
* tree-ssa-live.c (remove_unused_locals): Do not remove
heap variables.
* tree-ssa-structalias.c (handle_lhs_call): Delay setting
of DECL_EXTERNAL for HEAP variables.
(compute_points_to_sets): Set DECL_EXTERNAL for escaped
HEAP variables. Do not adjust RESTRICT vars.
(find_what_var_points_to): Nobody cares if something
points to READONLY.
2009-07-02 Ben Elliston <bje@au.ibm.com> 2009-07-02 Ben Elliston <bje@au.ibm.com>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Move * unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Move
......
...@@ -795,6 +795,7 @@ remove_unused_locals (void) ...@@ -795,6 +795,7 @@ remove_unused_locals (void)
&& TREE_CODE (t) != PARM_DECL && TREE_CODE (t) != PARM_DECL
&& TREE_CODE (t) != RESULT_DECL && TREE_CODE (t) != RESULT_DECL
&& !(ann = var_ann (t))->used && !(ann = var_ann (t))->used
&& !ann->is_heapvar
&& !TREE_ADDRESSABLE (t)) && !TREE_ADDRESSABLE (t))
remove_referenced_var (t); remove_referenced_var (t);
remove_unused_scope_block_p (DECL_INITIAL (current_function_decl)); remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));
......
...@@ -3475,6 +3475,7 @@ handle_lhs_call (tree lhs, int flags, VEC(ce_s, heap) *rhsc) ...@@ -3475,6 +3475,7 @@ handle_lhs_call (tree lhs, int flags, VEC(ce_s, heap) *rhsc)
vi = make_constraint_from_heapvar (get_vi_for_tree (lhs), "HEAP"); vi = make_constraint_from_heapvar (get_vi_for_tree (lhs), "HEAP");
/* We delay marking allocated storage global until we know if /* We delay marking allocated storage global until we know if
it escapes. */ it escapes. */
DECL_EXTERNAL (vi->decl) = 0;
vi->is_global_var = 0; vi->is_global_var = 0;
} }
else if (VEC_length (ce_s, rhsc) > 0) else if (VEC_length (ce_s, rhsc) > 0)
...@@ -4785,8 +4786,10 @@ find_what_var_points_to (varinfo_t vi, struct pt_solution *pt) ...@@ -4785,8 +4786,10 @@ find_what_var_points_to (varinfo_t vi, struct pt_solution *pt)
else if (vi->is_heap_var) else if (vi->is_heap_var)
/* We represent heapvars in the points-to set properly. */ /* We represent heapvars in the points-to set properly. */
; ;
else if (vi->id == readonly_id)
/* Nobody cares. */
;
else if (vi->id == anything_id else if (vi->id == anything_id
|| vi->id == readonly_id
|| vi->id == integer_id) || vi->id == integer_id)
pt->anything = 1; pt->anything = 1;
} }
...@@ -5460,9 +5463,10 @@ compute_points_to_sets (void) ...@@ -5460,9 +5463,10 @@ compute_points_to_sets (void)
/* Mark escaped HEAP variables as global. */ /* Mark escaped HEAP variables as global. */
for (i = 0; VEC_iterate (varinfo_t, varmap, i, vi); ++i) for (i = 0; VEC_iterate (varinfo_t, varmap, i, vi); ++i)
if (vi->is_heap_var if (vi->is_heap_var
&& !vi->is_restrict_var
&& !vi->is_global_var) && !vi->is_global_var)
vi->is_global_var = pt_solution_includes (&cfun->gimple_df->escaped, DECL_EXTERNAL (vi->decl) = vi->is_global_var
vi->decl); = pt_solution_includes (&cfun->gimple_df->escaped, vi->decl);
/* Compute the points-to sets for pointer SSA_NAMEs. */ /* Compute the points-to sets for pointer SSA_NAMEs. */
for (i = 0; i < num_ssa_names; ++i) for (i = 0; i < num_ssa_names; ++i)
......
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