diff options
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index d4a1e219a0c..3aa79feddd6 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -2370,6 +2370,8 @@ have_common_aliases_p (bitmap tag1aliases, bitmap tag2aliases) static void compute_flow_insensitive_aliasing (struct alias_info *ai) { + referenced_var_iterator rvi; + tree var; size_t i; timevar_push (TV_FLOW_INSENSITIVE); @@ -2460,6 +2462,24 @@ compute_flow_insensitive_aliasing (struct alias_info *ai) add_may_alias (tag1, tag2); } } + + /* We have to add all HEAP variables to all SMTs aliases bitmaps. + As we don't know which effective type the HEAP will have we cannot + do better here and we need the conflicts with obfuscated pointers + (a simple (*(int[n] *)ptr)[i] will do, with ptr from a VLA array + allocation). */ + for (i = 0; i < ai->num_pointers; i++) + { + struct alias_map_d *p_map = ai->pointers[i]; + tree tag = symbol_mem_tag (p_map->var); + + FOR_EACH_REFERENCED_VAR (var, rvi) + { + if (var_ann (var)->is_heapvar) + add_may_alias (tag, var); + } + } + timevar_pop (TV_FLOW_INSENSITIVE); } |