aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-09-02 11:58:27 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-09-02 11:58:27 +0000
commit638381579be16f630292273a23ffc9282906ada9 (patch)
tree8abc37f10cdf2132775fb5ee7b794240831fd6ec /gcc/tree-ssa-alias.c
parent42c089971e4987c1fc1338d7ff659f2be9c9b7e5 (diff)
downloadgcc-638381579be16f630292273a23ffc9282906ada9.zip
gcc-638381579be16f630292273a23ffc9282906ada9.tar.gz
gcc-638381579be16f630292273a23ffc9282906ada9.tar.bz2
revert: builtins.c (fold_builtin_memory_op): Use the alias oracle to query if the memory regions for memmove overlap.
2009-09-02 Richard Guenther <rguenther@suse.de> Revert 2009-08-31 Richard Guenther <rguenther@suse.de> * builtins.c (fold_builtin_memory_op): Use the alias oracle to query if the memory regions for memmove overlap. * tree-ssa-alias.c (ptr_deref_may_alias_decl_p): Relax the asserts on pointers, instead deal with odd trees. (ptr_derefs_may_alias_p): Likewise. (refs_may_alias_p_1): Constructor bases also never alias. From-SVN: r151320
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 14f1fb4..7e83a84 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -168,9 +168,12 @@ ptr_deref_may_alias_decl_p (tree ptr, tree decl)
{
struct ptr_info_def *pi;
- gcc_assert (TREE_CODE (decl) == VAR_DECL
- || TREE_CODE (decl) == PARM_DECL
- || TREE_CODE (decl) == RESULT_DECL);
+ gcc_assert ((TREE_CODE (ptr) == SSA_NAME
+ || TREE_CODE (ptr) == ADDR_EXPR
+ || TREE_CODE (ptr) == INTEGER_CST)
+ && (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == PARM_DECL
+ || TREE_CODE (decl) == RESULT_DECL));
/* Non-aliased variables can not be pointed to. */
if (!may_be_aliased (decl))
@@ -194,9 +197,9 @@ ptr_deref_may_alias_decl_p (tree ptr, tree decl)
return true;
}
- /* We can end up with dereferencing non-SSA name pointers.
+ /* We can end up with dereferencing constant pointers.
Just bail out in this case. */
- if (TREE_CODE (ptr) != SSA_NAME)
+ if (TREE_CODE (ptr) == INTEGER_CST)
return true;
/* If we do not have useful points-to information for this pointer
@@ -217,6 +220,13 @@ ptr_derefs_may_alias_p (tree ptr1, tree ptr2)
{
struct ptr_info_def *pi1, *pi2;
+ gcc_assert ((TREE_CODE (ptr1) == SSA_NAME
+ || TREE_CODE (ptr1) == ADDR_EXPR
+ || TREE_CODE (ptr1) == INTEGER_CST)
+ && (TREE_CODE (ptr2) == SSA_NAME
+ || TREE_CODE (ptr2) == ADDR_EXPR
+ || TREE_CODE (ptr2) == INTEGER_CST));
+
/* ADDR_EXPR pointers either just offset another pointer or directly
specify the pointed-to set. */
if (TREE_CODE (ptr1) == ADDR_EXPR)
@@ -244,10 +254,10 @@ ptr_derefs_may_alias_p (tree ptr1, tree ptr2)
return true;
}
- /* We can end up with dereferencing non-SSA name pointers.
+ /* We can end up with dereferencing constant pointers.
Just bail out in this case. */
- if (TREE_CODE (ptr1) != SSA_NAME
- || TREE_CODE (ptr2) != SSA_NAME)
+ if (TREE_CODE (ptr1) == INTEGER_CST
+ || TREE_CODE (ptr2) == INTEGER_CST)
return true;
/* We may end up with two empty points-to solutions for two same pointers.
@@ -771,9 +781,7 @@ refs_may_alias_p_1 (ao_ref *ref1, ao_ref *ref2, bool tbaa_p)
if (TREE_CODE (base1) == SSA_NAME
|| TREE_CODE (base2) == SSA_NAME
|| is_gimple_min_invariant (base1)
- || is_gimple_min_invariant (base2)
- || TREE_CODE (base1) == CONSTRUCTOR
- || TREE_CODE (base2) == CONSTRUCTOR)
+ || is_gimple_min_invariant (base2))
return false;
/* Defer to simple offset based disambiguation if we have