diff options
author | Richard Guenther <rguenther@suse.de> | 2008-04-23 14:08:25 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-04-23 14:08:25 +0000 |
commit | 17d2c090a10e1ff15d78e4e139f7df7c39a54d4e (patch) | |
tree | 1b094aa3273abc829435f2f6a7c4089e8476d961 /gcc/tree-ssa-alias.c | |
parent | a7a512beff448f28fc2f9f192e19e30cbf971eba (diff) | |
download | gcc-17d2c090a10e1ff15d78e4e139f7df7c39a54d4e.zip gcc-17d2c090a10e1ff15d78e4e139f7df7c39a54d4e.tar.gz gcc-17d2c090a10e1ff15d78e4e139f7df7c39a54d4e.tar.bz2 |
re PR tree-optimization/27799 (adding unused char field inhibits optimization)
2008-04-23 Richard Guenther <rguenther@suse.de>
PR tree-optimization/27799
PR tree-optimization/32921
PR tree-optimization/32624
* tree-ssa-structalias.c (merge_smts_into): Only merge the
SMTs aliases and the tag itself into the solution.
* tree-ssa-alias.c (compute_flow_sensitive_aliasing): Do not
merge the points-to solution back into the SMT aliases.
(may_alias_p): Use alias_set_subset_of instead of
aliases_conflict_p. A pointer which points to
memory with alias set zero may access any variable.
* gcc.dg/tree-ssa/pr27799.c: New testcase.
* gcc.dg/tree-ssa/20030807-7.c: Remove xfail, scan vrp dump.
From-SVN: r134598
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index eb57010..ecc827a 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -2354,7 +2354,6 @@ compute_flow_sensitive_aliasing (struct alias_info *ai) for (i = 0; VEC_iterate (tree, ai->processed_ptrs, i, ptr); i++) { struct ptr_info_def *pi = SSA_NAME_PTR_INFO (ptr); - tree tag = symbol_mem_tag (SSA_NAME_VAR (ptr)); /* Set up aliasing information for PTR's name memory tag (if it has one). Note that only pointers that have been dereferenced will @@ -2362,18 +2361,7 @@ compute_flow_sensitive_aliasing (struct alias_info *ai) if (pi->name_mem_tag && pi->pt_vars) { if (!bitmap_empty_p (pi->pt_vars)) - { - union_alias_set_into (pi->name_mem_tag, pi->pt_vars); - union_alias_set_into (tag, pi->pt_vars); - bitmap_clear_bit (MTAG_ALIASES (tag), DECL_UID (tag)); - - /* It may be the case that this the tag uid was the only - bit we had set in the aliases list, and in this case, - we don't want to keep an empty bitmap, as this - asserts in tree-ssa-operands.c . */ - if (bitmap_empty_p (MTAG_ALIASES (tag))) - BITMAP_FREE (MTAG_ALIASES (tag)); - } + union_alias_set_into (pi->name_mem_tag, pi->pt_vars); } } timevar_pop (TV_FLOW_SENSITIVE); @@ -2860,8 +2848,19 @@ may_alias_p (tree ptr, alias_set_type mem_alias_set, { alias_stats.tbaa_queries++; + /* If the pointed to memory has alias set zero or the pointer + is ref-all, the MEM can alias VAR. */ + if (mem_alias_set == 0 + || PTR_IS_REF_ALL (ptr)) + { + alias_stats.alias_mayalias++; + alias_stats.tbaa_resolved++; + return true; + } + /* If the alias sets don't conflict then MEM cannot alias VAR. */ - if (!alias_sets_conflict_p (mem_alias_set, var_alias_set)) + if (mem_alias_set != var_alias_set + && !alias_set_subset_of (mem_alias_set, var_alias_set)) { alias_stats.alias_noalias++; alias_stats.tbaa_resolved++; |