diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-20 12:12:26 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-20 12:12:26 +0000 |
commit | 8b3ad377e826983a6b73cb022b9a60883bd96eb0 (patch) | |
tree | cdf016ccfee9535d947293659d02084b8b2cc3e7 /gcc/tree-ssa-structalias.c | |
parent | 2d88b1afa0dffcd0b413795c8e1e01f5474e4334 (diff) | |
download | gcc-8b3ad377e826983a6b73cb022b9a60883bd96eb0.tar.gz |
2011-07-20 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (new_var_info): Allocate oldsolution
lazily.
(unify_nodes): Deal with that.
(solve_graph): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176505 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r-- | gcc/tree-ssa-structalias.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 82f39c2fcad..9bfbad63f70 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -362,7 +362,7 @@ new_var_info (tree t, const char *name) || (TREE_CODE (t) == VAR_DECL && DECL_HARD_REGISTER (t))); ret->solution = BITMAP_ALLOC (&pta_obstack); - ret->oldsolution = BITMAP_ALLOC (&oldpta_obstack); + ret->oldsolution = NULL; ret->next = NULL; stats.total_vars++; @@ -1504,13 +1504,12 @@ unify_nodes (constraint_graph_t graph, unsigned int to, unsigned int from, } BITMAP_FREE (get_varinfo (from)->solution); - BITMAP_FREE (get_varinfo (from)->oldsolution); + if (get_varinfo (from)->oldsolution) + BITMAP_FREE (get_varinfo (from)->oldsolution); - if (stats.iterations > 0) - { - BITMAP_FREE (get_varinfo (to)->oldsolution); - get_varinfo (to)->oldsolution = BITMAP_ALLOC (&oldpta_obstack); - } + if (stats.iterations > 0 + && get_varinfo (to)->oldsolution) + BITMAP_FREE (get_varinfo (to)->oldsolution); } if (valid_graph_edge (graph, to, to)) { @@ -2544,18 +2543,27 @@ solve_graph (constraint_graph_t graph) constraint_t c; bitmap solution; VEC(constraint_t,heap) *complex = graph->complex[i]; + varinfo_t vi = get_varinfo (i); bool solution_empty; /* Compute the changed set of solution bits. */ - bitmap_and_compl (pts, get_varinfo (i)->solution, - get_varinfo (i)->oldsolution); + if (vi->oldsolution) + bitmap_and_compl (pts, vi->solution, vi->oldsolution); + else + bitmap_copy (pts, vi->solution); if (bitmap_empty_p (pts)) continue; - bitmap_ior_into (get_varinfo (i)->oldsolution, pts); + if (vi->oldsolution) + bitmap_ior_into (vi->oldsolution, pts); + else + { + vi->oldsolution = BITMAP_ALLOC (&oldpta_obstack); + bitmap_copy (vi->oldsolution, pts); + } - solution = get_varinfo (i)->solution; + solution = vi->solution; solution_empty = bitmap_empty_p (solution); /* Process the complex constraints */ |