===================================================================
@@ -316,11 +316,6 @@ ptr_derefs_may_alias_p (tree ptr1, tree
if (!pi1 || !pi2)
return true;
- /* If both pointers are restrict-qualified try to disambiguate
- with restrict information. */
- if (!pt_solutions_same_restrict_base (&pi1->pt, &pi2->pt))
- return false;
-
/* ??? This does not use TBAA to prune decls from the intersection
that not both pointers may access. */
return pt_solutions_intersect (&pi1->pt, &pi2->pt);
===================================================================
@@ -130,8 +130,6 @@ extern bool pt_solution_singleton_p (str
extern bool pt_solution_includes_global (struct pt_solution *);
extern bool pt_solution_includes (struct pt_solution *, const_tree);
extern bool pt_solutions_intersect (struct pt_solution *, struct pt_solution *);
-extern bool pt_solutions_same_restrict_base (struct pt_solution *,
- struct pt_solution *);
extern void pt_solution_reset (struct pt_solution *);
extern void pt_solution_set (struct pt_solution *, bitmap, bool, bool);
extern void pt_solution_set_var (struct pt_solution *, tree);
===================================================================
@@ -6079,12 +6079,15 @@ pt_solutions_intersect_1 (struct pt_solu
return true;
/* If either points to unknown global memory and the other points to
- any global memory they alias. */
- if ((pt1->nonlocal
- && (pt2->nonlocal
- || pt2->vars_contains_global))
- || (pt2->nonlocal
- && pt1->vars_contains_global))
+ any global memory they alias. If both points-to sets are based
+ off a restrict qualified pointer ignore any overlaps with NONLOCAL. */
+ if (!(pt1->vars_contains_restrict
+ && pt2->vars_contains_restrict)
+ && ((pt1->nonlocal
+ && (pt2->nonlocal
+ || pt2->vars_contains_global))
+ || (pt2->nonlocal
+ && pt1->vars_contains_global)))
return true;
/* Check the escaped solution if required. */
@@ -6141,27 +6144,6 @@ pt_solutions_intersect (struct pt_soluti
return res;
}
-/* Return true if both points-to solutions PT1 and PT2 for two restrict
- qualified pointers are possibly based on the same pointer. */
-
-bool
-pt_solutions_same_restrict_base (struct pt_solution *pt1,
- struct pt_solution *pt2)
-{
- /* If we deal with points-to solutions of two restrict qualified
- pointers solely rely on the pointed-to variable bitmap intersection.
- For two pointers that are based on each other the bitmaps will
- intersect. */
- if (pt1->vars_contains_restrict
- && pt2->vars_contains_restrict)
- {
- gcc_assert (pt1->vars && pt2->vars);
- return bitmap_intersect_p (pt1->vars, pt2->vars);
- }
-
- return true;
-}
-
/* Dump points-to information to OUTFILE. */