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
This commit is contained in:
Richard Guenther 2009-07-02 10:18:24 +00:00 committed by Richard Biener
parent 3e37f41e5a
commit 91deb93712
3 changed files with 19 additions and 3 deletions

View File

@ -1,3 +1,14 @@
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>
* unwind-dw2-fde-glibc.c (_Unwind_IteratePhdrCallback): Move

View File

@ -795,6 +795,7 @@ remove_unused_locals (void)
&& TREE_CODE (t) != PARM_DECL
&& TREE_CODE (t) != RESULT_DECL
&& !(ann = var_ann (t))->used
&& !ann->is_heapvar
&& !TREE_ADDRESSABLE (t))
remove_referenced_var (t);
remove_unused_scope_block_p (DECL_INITIAL (current_function_decl));

View File

@ -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");
/* We delay marking allocated storage global until we know if
it escapes. */
DECL_EXTERNAL (vi->decl) = 0;
vi->is_global_var = 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)
else if (vi->is_heap_var)
/* We represent heapvars in the points-to set properly. */
;
else if (vi->id == readonly_id)
/* Nobody cares. */
;
else if (vi->id == anything_id
|| vi->id == readonly_id
|| vi->id == integer_id)
pt->anything = 1;
}
@ -5460,9 +5463,10 @@ compute_points_to_sets (void)
/* Mark escaped HEAP variables as global. */
for (i = 0; VEC_iterate (varinfo_t, varmap, i, vi); ++i)
if (vi->is_heap_var
&& !vi->is_restrict_var
&& !vi->is_global_var)
vi->is_global_var = pt_solution_includes (&cfun->gimple_df->escaped,
vi->decl);
DECL_EXTERNAL (vi->decl) = vi->is_global_var
= pt_solution_includes (&cfun->gimple_df->escaped, vi->decl);
/* Compute the points-to sets for pointer SSA_NAMEs. */
for (i = 0; i < num_ssa_names; ++i)