aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
-rw-r--r--gcc/tree-ssa-structalias.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c
index f48bcb2..96071d6 100644
--- a/gcc/tree-ssa-structalias.c
+++ b/gcc/tree-ssa-structalias.c
@@ -1849,13 +1849,14 @@ get_constraint_exp_from_ssa_var (tree t)
cexpr.type = SCALAR;
- if (TREE_READONLY (t))
+ cexpr.var = get_id_for_tree (t);
+ /* If we determine the result is "anything", and we know this is readonly,
+ say it points to readonly memory instead. */
+ if (cexpr.var == anything_id && TREE_READONLY (t))
{
cexpr.type = ADDRESSOF;
cexpr.var = readonly_id;
}
- else
- cexpr.var = get_id_for_tree (t);
cexpr.offset = 0;
return cexpr;