aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-11-23 10:30:02 +0100
committerJakub Jelinek <jakub@redhat.com>2021-11-23 10:30:02 +0100
commit5e9b973bd60185f221222022f56db7df3d92250e (patch)
tree194d9284a366f336a971164be0951e164621485c /gcc/tree-inline.c
parentf4eae6450e46224454ce067ac43bd7e9f66fc18b (diff)
downloadgcc-5e9b973bd60185f221222022f56db7df3d92250e.zip
gcc-5e9b973bd60185f221222022f56db7df3d92250e.tar.gz
gcc-5e9b973bd60185f221222022f56db7df3d92250e.tar.bz2
openmp: Fix up handling of reduction clauses on the loop construct [PR102431]
We were using unshare_expr and walk_tree_without_duplicate replacement of the placeholder vars. The OMP_CLAUSE_REDUCTION_{INIT,MERGE} can contain other trees that need to be duplicated though, e.g. BLOCKs referenced in BIND_EXPR(s), or local VAR_DECLs. This patch uses the inliner code to copy all of that. There is a slight complication that those local VAR_DECLs or placeholders don't have DECL_CONTEXT set, they will get that only when they are gimplified later on, so this patch sets DECL_CONTEXT for those temporarily and resets it afterwards. 2021-11-23 Jakub Jelinek <jakub@redhat.com> PR middle-end/102431 * gimplify.c (replace_reduction_placeholders): Remove. (note_no_context_vars): New function. (gimplify_omp_loop): For OMP_PARALLEL's BIND_EXPR create a new BLOCK. Use copy_tree_body_r with walk_tree instead of unshare_expr and replace_reduction_placeholders for duplication of OMP_CLAUSE_REDUCTION_{INIT,MERGE} expressions. Ensure all mentioned automatic vars have DECL_CONTEXT set to non-NULL before doing so and reset it afterwards for those vars and their corresponding vars. * c-c++-common/gomp/pr102431.c: New test. * g++.dg/gomp/pr102431.C: New test. * gfortran.dg/gomp/pr102431.f90: New test.
Diffstat (limited to 'gcc/tree-inline.c')
0 files changed, 0 insertions, 0 deletions