diff options
author | Jan Hubicka <jh@suse.cz> | 2019-06-25 10:35:01 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2019-06-25 08:35:01 +0000 |
commit | a7e8a463cd1dbaccf6e7c4fa888768fcd257a30f (patch) | |
tree | 75d8ca792d34f7dc72367de958a454d33cea8eb6 /gcc/tree-ssa-alias.c | |
parent | 1a3e38aee22d2b6f8f990b05c9fdb5eeb316acfd (diff) | |
download | gcc-a7e8a463cd1dbaccf6e7c4fa888768fcd257a30f.zip gcc-a7e8a463cd1dbaccf6e7c4fa888768fcd257a30f.tar.gz gcc-a7e8a463cd1dbaccf6e7c4fa888768fcd257a30f.tar.bz2 |
tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Check that base2_alias_set is non-zero before doing TBAA based disambiguation.
* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Check that
base2_alias_set is non-zero before doing TBAA based disambiguation.
From-SVN: r272639
Diffstat (limited to 'gcc/tree-ssa-alias.c')
-rw-r--r-- | gcc/tree-ssa-alias.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c index d930739..48f7364 100644 --- a/gcc/tree-ssa-alias.c +++ b/gcc/tree-ssa-alias.c @@ -1458,10 +1458,8 @@ indirect_ref_may_alias_decl_p (tree ref1 ATTRIBUTE_UNUSED, tree base1, if (!flag_strict_aliasing || !tbaa_p) return true; - ptrtype1 = TREE_TYPE (TREE_OPERAND (base1, 1)); - /* If the alias set for a pointer access is zero all bets are off. */ - if (base1_alias_set == 0) + if (base1_alias_set == 0 || base2_alias_set == 0) return true; /* When we are trying to disambiguate an access with a pointer dereference @@ -1479,6 +1477,9 @@ indirect_ref_may_alias_decl_p (tree ref1 ATTRIBUTE_UNUSED, tree base1, if (base1_alias_set != base2_alias_set && !alias_sets_conflict_p (base1_alias_set, base2_alias_set)) return false; + + ptrtype1 = TREE_TYPE (TREE_OPERAND (base1, 1)); + /* If the size of the access relevant for TBAA through the pointer is bigger than the size of the decl we can't possibly access the decl via that pointer. */ |