diff options
author | Tom de Vries <tom@codesourcery.com> | 2015-08-23 09:19:32 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2015-08-23 09:19:32 +0000 |
commit | 2eddac76ab90866dbab1b2016450295ea3ea22f7 (patch) | |
tree | 4eace75bf5f230bec99589e23b38ec7b718697b0 /gcc/omp-low.c | |
parent | 1b950569994b39283865554b39fa75c32ca879d4 (diff) | |
download | gcc-2eddac76ab90866dbab1b2016450295ea3ea22f7.zip gcc-2eddac76ab90866dbab1b2016450295ea3ea22f7.tar.gz gcc-2eddac76ab90866dbab1b2016450295ea3ea22f7.tar.bz2 |
Don't create superfluous parm in expand_omp_taskreg
2015-08-23 Tom de Vries <tom@codesourcery.com>
* omp-low.c (expand_omp_taskreg): If in ssa, set rhs of parcopy stmt to
parm_decl, rather than generating a dummy default def in cfun.
* tree-cfg.c (replace_ssa_name): Assume no default defs. Make sure
ssa_name from cfun and child_fn do not share a stmt as def stmt.
(move_stmt_op): Handle PARM_DECl.
(gather_ssa_name_hash_map_from): New function.
(move_sese_region_to_fn): Add default defs for function params, and add
them to vars_map. Release copied ssa names.
* tree-cfg.h (gather_ssa_name_hash_map_from): Declare.
From-SVN: r227103
Diffstat (limited to 'gcc/omp-low.c')
-rw-r--r-- | gcc/omp-low.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 7cf51b3..d181101 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -5417,7 +5417,7 @@ expand_omp_taskreg (struct omp_region *region) basic_block entry_succ_bb = single_succ_p (entry_bb) ? single_succ (entry_bb) : FALLTHRU_EDGE (entry_bb)->dest; - tree arg, narg; + tree arg; gimple parcopy_stmt = NULL; for (gsi = gsi_start_bb (entry_succ_bb); ; gsi_next (&gsi)) @@ -5462,15 +5462,15 @@ expand_omp_taskreg (struct omp_region *region) } else { - /* If we are in ssa form, we must load the value from the default - definition of the argument. That should not be defined now, - since the argument is not used uninitialized. */ - gcc_assert (ssa_default_def (cfun, arg) == NULL); - narg = make_ssa_name (arg, gimple_build_nop ()); - set_ssa_default_def (cfun, arg, narg); - /* ?? Is setting the subcode really necessary ?? */ - gimple_omp_set_subcode (parcopy_stmt, TREE_CODE (narg)); - gimple_assign_set_rhs1 (parcopy_stmt, narg); + tree lhs = gimple_assign_lhs (parcopy_stmt); + gcc_assert (SSA_NAME_VAR (lhs) == arg); + /* We'd like to set the rhs to the default def in the child_fn, + but it's too early to create ssa names in the child_fn. + Instead, we set the rhs to the parm. In + move_sese_region_to_fn, we introduce a default def for the + parm, map the parm to it's default def, and once we encounter + this stmt, replace the parm with the default def. */ + gimple_assign_set_rhs1 (parcopy_stmt, arg); update_stmt (parcopy_stmt); } } |