diff options
author | Iain Sandoe <iain@sandoe.co.uk> | 2022-04-29 17:54:39 +0100 |
---|---|---|
committer | Iain Sandoe <iain@sandoe.co.uk> | 2022-04-29 17:54:39 +0100 |
commit | 3e5f7ca352c26a222bb588741b7c700a3052a372 (patch) | |
tree | 283aec084274668fe34c23c49ab2999390ed9778 /gcc/tree-ssa-structalias.cc | |
parent | 2ce0608ca3dca30518bec525c435f7bc4d7f9b70 (diff) | |
parent | b85e79dce149df68b92ef63ca2a40ff1dfa61396 (diff) | |
download | gcc-devel/c++-coroutines.tar.gz |
Merge master r12-8312.devel/c++-coroutines
* Merge master r12-8312-gb85e79dce149.
Diffstat (limited to 'gcc/tree-ssa-structalias.cc')
-rw-r--r-- | gcc/tree-ssa-structalias.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index d318f883e70..581bdcf5652 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -6995,10 +6995,12 @@ pt_solution_singleton_or_null_p (struct pt_solution *pt, unsigned *uid) return true; } -/* Return true if the points-to solution *PT includes global memory. */ +/* Return true if the points-to solution *PT includes global memory. + If ESCAPED_LOCAL_P is true then escaped local variables are also + considered global. */ bool -pt_solution_includes_global (struct pt_solution *pt) +pt_solution_includes_global (struct pt_solution *pt, bool escaped_local_p) { if (pt->anything || pt->nonlocal @@ -7009,12 +7011,17 @@ pt_solution_includes_global (struct pt_solution *pt) || pt->vars_contains_escaped_heap) return true; + if (escaped_local_p && pt->vars_contains_escaped) + return true; + /* 'escaped' is also a placeholder so we have to look into it. */ if (pt->escaped) - return pt_solution_includes_global (&cfun->gimple_df->escaped); + return pt_solution_includes_global (&cfun->gimple_df->escaped, + escaped_local_p); if (pt->ipa_escaped) - return pt_solution_includes_global (&ipa_escaped_pt); + return pt_solution_includes_global (&ipa_escaped_pt, + escaped_local_p); return false; } |