aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-alias.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r--gcc/tree-ssa-alias.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c
index 3f0c650..0dcb273 100644
--- a/gcc/tree-ssa-alias.c
+++ b/gcc/tree-ssa-alias.c
@@ -1096,13 +1096,16 @@ decl_refs_may_alias_p (tree ref1, tree base1,
{
gcc_checking_assert (DECL_P (base1) && DECL_P (base2));
+ int cmp = compare_base_decls (base1, base2);
+
/* If both references are based on different variables, they cannot alias. */
- if (compare_base_decls (base1, base2) == 0)
+ if (cmp == 0)
return false;
/* If both references are based on the same variable, they cannot alias if
the accesses do not overlap. */
- if (!ranges_overlap_p (offset1, max_size1, offset2, max_size2))
+ if (cmp == 1
+ && !ranges_overlap_p (offset1, max_size1, offset2, max_size2))
return false;
/* For components with variable position, the above test isn't sufficient,