aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-07-02 10:18:24 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-07-02 10:18:24 +0000
commit91deb93712047ca1b5d3d5ddf8b0f12b4a164ef8 (patch)
tree311b16650e82552b4d5ec734b325f969addba653 /gcc/tree-ssa-structalias.c
parent3e37f41e5ad844b1a7e5717bd04c93740699e1d7 (diff)
downloadgcc-91deb93712047ca1b5d3d5ddf8b0f12b4a164ef8.zip
gcc-91deb93712047ca1b5d3d5ddf8b0f12b4a164ef8.tar.gz
gcc-91deb93712047ca1b5d3d5ddf8b0f12b4a164ef8.tar.bz2
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
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 84edf00..95ca882 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -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)