diff options
author | Tom de Vries <tom@codesourcery.com> | 2017-10-26 20:09:24 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2017-10-26 20:09:24 +0000 |
commit | 8a866b8296874b5f6f3371bb368c8191c828d98f (patch) | |
tree | 00351b7712e085fcaf83085385a67c81479e527b /gcc/gimple.c | |
parent | 7e23f4a6f80994e305f35f6de6f79966becaa92d (diff) | |
download | gcc-8a866b8296874b5f6f3371bb368c8191c828d98f.zip gcc-8a866b8296874b5f6f3371bb368c8191c828d98f.tar.gz gcc-8a866b8296874b5f6f3371bb368c8191c828d98f.tar.bz2 |
Fix unsharing of GIMPLE_OMP_{SINGLE,TARGET,TEAMS} in gimple_copy
2017-10-26 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/82707
* gimple.c (gimple_copy): Fix unsharing of
GIMPLE_OMP_{SINGLE,TARGET,TEAMS}.
From-SVN: r254120
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 1f291e1..37f2248 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1840,11 +1840,35 @@ gimple_copy (gimple *stmt) gimple_omp_sections_set_clauses (copy, t); t = unshare_expr (gimple_omp_sections_control (stmt)); gimple_omp_sections_set_control (copy, t); - /* FALLTHRU */ + goto copy_omp_body; case GIMPLE_OMP_SINGLE: + { + gomp_single *omp_single_copy = as_a <gomp_single *> (copy); + t = unshare_expr (gimple_omp_single_clauses (stmt)); + gimple_omp_single_set_clauses (omp_single_copy, t); + } + goto copy_omp_body; + case GIMPLE_OMP_TARGET: + { + gomp_target *omp_target_stmt = as_a <gomp_target *> (stmt); + gomp_target *omp_target_copy = as_a <gomp_target *> (copy); + t = unshare_expr (gimple_omp_target_clauses (omp_target_stmt)); + gimple_omp_target_set_clauses (omp_target_copy, t); + t = unshare_expr (gimple_omp_target_data_arg (omp_target_stmt)); + gimple_omp_target_set_data_arg (omp_target_copy, t); + } + goto copy_omp_body; + case GIMPLE_OMP_TEAMS: + { + gomp_teams *omp_teams_copy = as_a <gomp_teams *> (copy); + t = unshare_expr (gimple_omp_teams_clauses (stmt)); + gimple_omp_teams_set_clauses (omp_teams_copy, t); + } + /* FALLTHRU */ + case GIMPLE_OMP_SECTION: case GIMPLE_OMP_MASTER: case GIMPLE_OMP_TASKGROUP: |