summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-20 13:57:44 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-04-20 13:57:44 +0000
commite11485353cd31f3a08c8e4870a0cac6f6cd8c4a9 (patch)
tree551540181227ce7439f560e0f1ab3cb8d2e10ea2 /gcc/tree-ssa-structalias.c
parent3eaadea64f843ec8640a057929ea966d1853fd2c (diff)
downloadgcc-e11485353cd31f3a08c8e4870a0cac6f6cd8c4a9.tar.gz
2010-04-20 Richard Guenther <rguenther@suse.de>
* tree-ssa-structalias.c (do_sd_constraint): Add edges only from vars that can have pointers. (process_constraint): Dump useless constraints. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158558 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index 781eff30872..492907e5805 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1706,7 +1706,8 @@ do_sd_constraint (constraint_graph_t graph, constraint_t c,
the set. Use ESCAPED as representative instead. */
else if (v->id == escaped_id)
flag |= bitmap_set_bit (sol, escaped_id);
- else if (add_graph_edge (graph, lhs, t))
+ else if (v->may_have_pointers
+ && add_graph_edge (graph, lhs, t))
flag |= bitmap_ior_into (sol, get_varinfo (t)->solution);
/* If the variable is not exactly at the requested offset
@@ -2885,6 +2886,16 @@ process_constraint (constraint_t t)
/* ADDRESSOF on the lhs is invalid. */
gcc_assert (lhs.type != ADDRESSOF);
+ /* We shouldn't add constraints from things that cannot have pointers.
+ It's not completely trivial to avoid in the callers, so do it here. */
+ if (rhs.type != ADDRESSOF
+ && !get_varinfo (rhs.var)->may_have_pointers)
+ return;
+
+ /* Likewise adding to the solution of a non-pointer var isn't useful. */
+ if (!get_varinfo (lhs.var)->may_have_pointers)
+ return;
+
/* This can happen in our IR with things like n->a = *p */
if (rhs.type == DEREF && lhs.type == DEREF && rhs.var != anything_id)
{