Commit 9edfa4c0 by Jan Hubicka

tree-ssa-alias.c (aliasing_component_refs_p): Continue looking for comparaible…

tree-ssa-alias.c (aliasing_component_refs_p): Continue looking for comparaible types in the second direction even if...

	* tree-ssa-alias.c (aliasing_component_refs_p): Continue looking
	for comparaible types in the second direction even if first one
	hits incomparable type.

From-SVN: r270938
parent fe267711
2019-05-03 Jan Hubicka <hubicka@ucw.cz>
* tree-ssa-alias.c (aliasing_component_refs_p): Continue looking
for comparaible types in the second direction even if first one
hits incomparable type.
2019-05-07 Richard Biener <rguenther@suse.de> 2019-05-07 Richard Biener <rguenther@suse.de>
PR lto/90369 PR lto/90369
...@@ -189,6 +195,7 @@ ...@@ -189,6 +195,7 @@
and macros. and macros.
* config/i386/t-i386: Define dependencies for new files. * config/i386/t-i386: Define dependencies for new files.
>>>>>>> .r270937
2019-05-03 Richard Earnshaw <rearnsha@arm.com> 2019-05-03 Richard Earnshaw <rearnsha@arm.com>
PR target/89400 PR target/89400
......
...@@ -795,7 +795,7 @@ aliasing_component_refs_p (tree ref1, ...@@ -795,7 +795,7 @@ aliasing_component_refs_p (tree ref1,
tree base1, base2; tree base1, base2;
tree type1, type2; tree type1, type2;
tree *refp; tree *refp;
int same_p; int same_p, same_p2;
/* Choose bases and base types to search for. */ /* Choose bases and base types to search for. */
base1 = ref1; base1 = ref1;
...@@ -814,10 +814,7 @@ aliasing_component_refs_p (tree ref1, ...@@ -814,10 +814,7 @@ aliasing_component_refs_p (tree ref1,
&& same_type_for_tbaa (TREE_TYPE (*refp), type1) == 0) && same_type_for_tbaa (TREE_TYPE (*refp), type1) == 0)
refp = &TREE_OPERAND (*refp, 0); refp = &TREE_OPERAND (*refp, 0);
same_p = same_type_for_tbaa (TREE_TYPE (*refp), type1); same_p = same_type_for_tbaa (TREE_TYPE (*refp), type1);
/* If we couldn't compare types we have to bail out. */ if (same_p == 1)
if (same_p == -1)
return true;
else if (same_p == 1)
{ {
poly_int64 offadj, sztmp, msztmp; poly_int64 offadj, sztmp, msztmp;
bool reverse; bool reverse;
...@@ -827,26 +824,31 @@ aliasing_component_refs_p (tree ref1, ...@@ -827,26 +824,31 @@ aliasing_component_refs_p (tree ref1,
offset1 -= offadj; offset1 -= offadj;
return ranges_maybe_overlap_p (offset1, max_size1, offset2, max_size2); return ranges_maybe_overlap_p (offset1, max_size1, offset2, max_size2);
} }
/* If we didn't find a common base, try the other way around. */ /* If we didn't find a common base, try the other way around. */
refp = &ref1; refp = &ref1;
while (handled_component_p (*refp) while (handled_component_p (*refp)
&& same_type_for_tbaa (TREE_TYPE (*refp), type2) == 0) && same_type_for_tbaa (TREE_TYPE (*refp), type2) == 0)
refp = &TREE_OPERAND (*refp, 0); refp = &TREE_OPERAND (*refp, 0);
same_p = same_type_for_tbaa (TREE_TYPE (*refp), type2); same_p2 = same_type_for_tbaa (TREE_TYPE (*refp), type2);
/* If we couldn't compare types we have to bail out. */ if (same_p2 == 1)
if (same_p == -1)
return true;
else if (same_p == 1)
{ {
poly_int64 offadj, sztmp, msztmp; poly_int64 offadj, sztmp, msztmp;
bool reverse; bool reverse;
get_ref_base_and_extent (*refp, &offadj, &sztmp, &msztmp, &reverse); get_ref_base_and_extent (*refp, &offadj, &sztmp, &msztmp, &reverse);
offset1 -= offadj; offset1 -= offadj;
get_ref_base_and_extent (base2, &offadj, &sztmp, &msztmp, &reverse); get_ref_base_and_extent (base2, &offadj, &sztmp, &msztmp, &reverse);
offset2 -= offadj; offset2 -= offadj;
return ranges_maybe_overlap_p (offset1, max_size1, offset2, max_size2); return ranges_maybe_overlap_p (offset1, max_size1,
offset2, max_size2);
} }
/* In the remaining test we assume that there is no overlapping type
at all. So if we are unsure, we need to give up. */
if (same_p == -1 || same_p2 == -1)
return true;
/* If we have two type access paths B1.path1 and B2.path2 they may /* If we have two type access paths B1.path1 and B2.path2 they may
only alias if either B1 is in B2.path2 or B2 is in B1.path1. only alias if either B1 is in B2.path2 or B2 is in B1.path1.
But we can still have a path that goes B1.path1...B2.path2 with But we can still have a path that goes B1.path1...B2.path2 with
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment