aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-03-15 08:46:04 +0100
committerRichard Biener <rguenther@suse.de>2023-04-19 14:14:14 +0200
commit6702fdcdf8b8c8ed27954972bb10b2464f4912fb (patch)
treeafdb99515227824ffcaba10940f93618575d0712 /gcc/tree-ssa-structalias.cc
parent8366e6764e18ca6526d9be87f5bb54ae8339d7f7 (diff)
downloadgcc-6702fdcdf8b8c8ed27954972bb10b2464f4912fb.zip
gcc-6702fdcdf8b8c8ed27954972bb10b2464f4912fb.tar.gz
gcc-6702fdcdf8b8c8ed27954972bb10b2464f4912fb.tar.bz2
Remove special-cased edges when solving copies
The following makes sure to remove the copy edges we ignore or need to special-case only once. * tree-ssa-structalias.cc (solve_graph): Remove self-copy edges, remove edges from escaped after special-casing them.
Diffstat (limited to 'gcc/tree-ssa-structalias.cc')
-rw-r--r--gcc/tree-ssa-structalias.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc
index 4f350bf..39c342f 100644
--- a/gcc/tree-ssa-structalias.cc
+++ b/gcc/tree-ssa-structalias.cc
@@ -2873,19 +2873,22 @@ solve_graph (constraint_graph_t graph)
}
/* Don't try to propagate to ourselves. */
if (to == i)
- continue;
-
- bitmap tmp = get_varinfo (to)->solution;
- bool flag = false;
-
- /* If we propagate from ESCAPED use ESCAPED as
- placeholder. */
+ {
+ to_remove = j;
+ continue;
+ }
+ /* Early node unification can lead to edges from
+ escaped - remove them. */
if (i == eff_escaped_id)
- flag = bitmap_set_bit (tmp, escaped_id);
- else
- flag = bitmap_ior_into (tmp, pts);
+ {
+ to_remove = j;
+ if (bitmap_set_bit (get_varinfo (to)->solution,
+ escaped_id))
+ bitmap_set_bit (changed, to);
+ continue;
+ }
- if (flag)
+ if (bitmap_ior_into (get_varinfo (to)->solution, pts))
bitmap_set_bit (changed, to);
}
if (to_remove != ~0U)